• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_mb_substr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_mb_substr函数的典型用法代码示例。如果您正苦于以下问题:PHP get_mb_substr函数的具体用法?PHP get_mb_substr怎么用?PHP get_mb_substr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_mb_substr函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: transferCategories

 function transferCategories()
 {
     $sSql = "SELECT \r\n        \t\t\t`CategoryID` AS `id`, \r\n        \t\t\t`CategoryName` AS `name`\r\n        \t\tFROM `ArticlesCategory`";
     $rResult = mysql_query($sSql, $this->rOldDb);
     $iCount = mysql_num_rows($rResult);
     while ($aCategory = mysql_fetch_assoc($rResult)) {
         if (get_mb_len($aCategory['name']) > 32) {
             $aCategory['name'] = get_mb_substr($aCategory['name'], 0, 32);
         }
         if ($this->existsCategory($aCategory['name'], 0, $this->_sType)) {
             continue;
         }
         //escape all values
         $aCategory['name'] = $this->oMigrationModule->_oDb->escape($aCategory['name']);
         $sSql = "INSERT INTO `sys_categories`(`Category`, `ID`, `Type`, `Owner`, `Status`, `Date`)\r\n            \t\t VALUES('" . $aCategory['name'] . "', '0', '" . $this->_sType . "', '0', 'active', NOW())";
         $iResult = (int) $this->oDolModule->_oDb->query($sSql);
         if ($iResult <= 0) {
             $this->setResultStatus('Database error. Cannot insert category in the database.');
             return MIGRATION_FAILED;
         }
     }
     return MIGRATION_SUCCESSFUL;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:23,代码来源:BxDataMigrationArticles.php


示例2: __construct

 /**
  * Constructor
  * $sSystem - comments system name
  * $iId - obect id to be commented
  */
 function __construct($sSystem, $iId, $iInit = 1)
 {
     parent::__construct();
     $this->_aSystems = $this->getSystems();
     if (!isset($this->_aSystems[$sSystem])) {
         return;
     }
     $this->_sSystem = $sSystem;
     $this->_aSystem = $this->_aSystems[$sSystem];
     $this->_aSystem['table_images'] = 'sys_cmts_images';
     $this->_aSystem['table_images2entries'] = 'sys_cmts_images2entries';
     $this->_aSystem['table_ids'] = 'sys_cmts_ids';
     $this->_aSystem['is_browse_filter'] = (int) $this->_bBrowseFilter;
     $this->_iDpMaxLevel = (int) $this->_aSystem['number_of_levels'];
     $this->_sDisplayType = $this->_iDpMaxLevel == 0 ? BX_CMT_DISPLAY_FLAT : BX_CMT_DISPLAY_THREADED;
     $this->_sDpSessionKey = 'bx_' . $this->_sSystem . '_dp_';
     $this->_sBrowseType = $this->_aSystem['browse_type'];
     $this->_sBrowseFilter = BX_CMT_FILTER_ALL;
     $this->_sBpSessionKeyType = 'bx_' . $this->_sSystem . '_bpt_';
     $this->_sBpSessionKeyFilter = 'bx_' . $this->_sSystem . '_bpf_';
     $this->_aOrder = array('by' => BX_CMT_ORDER_BY_DATE, 'way' => BX_CMT_ORDER_WAY_ASC);
     list($mixedUserDp, $mixedUserBpType, $mixedUserBpFilter) = $this->_getUserChoice();
     if (!empty($mixedUserDp)) {
         $this->_sDisplayType = $mixedUserDp;
     }
     if (!empty($mixedUserBpType)) {
         $this->_sBrowseType = $mixedUserBpType;
     }
     if (!empty($mixedUserBpFilter)) {
         $this->_sBrowseFilter = $mixedUserBpFilter;
     }
     $this->_sViewUrl = BX_DOL_URL_ROOT . 'cmts.php';
     $this->_sBaseUrl = BxDolPermalinks::getInstance()->permalink($this->_aSystem['base_url']);
     if (get_mb_substr($this->_sBaseUrl, 0, 4) != 'http') {
         $this->_sBaseUrl = BX_DOL_URL_ROOT . $this->_sBaseUrl;
     }
     $this->_sListAnchor = "cmts-anchor-%s-%d";
     $this->_oQuery = new BxDolCmtsQuery($this);
     $this->_sFormObject = 'sys_comment';
     $this->_sFormDisplayPost = 'sys_comment_post';
     $this->_sFormDisplayEdit = 'sys_comment_edit';
     $this->_sConnObjFriends = 'sys_profiles_friends';
     $this->_sConnObjSubscriptions = 'sys_profiles_subscriptions';
     $this->_sMenuObjManage = 'sys_cmts_item_manage';
     $this->_sMenuObjActions = 'sys_cmts_item_actions';
     $this->_sMetatagsObj = 'sys_cmts';
     if ($iInit) {
         $this->init($iId);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:55,代码来源:BxDolCmts.php


示例3: uriGenerate

function uriGenerate($s, $sTable, $sField, $iMaxLen = 255)
{
    $s = uriFilter($s);
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // try to add date
    if (get_mb_len($s) > 240) {
        $s = get_mb_substr($s, 0, 240);
    }
    $s .= '-' . date('Y-m-d');
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // try to add number
    for ($i = 0; $i < 999; ++$i) {
        if (uriCheckUniq($s . '-' . $i, $sTable, $sField)) {
            return $s . '-' . $i;
        }
    }
    return rand(0, 999999999);
}
开发者ID:blas-dmx,项目名称:dolphin.pro,代码行数:22,代码来源:utils.inc.php


示例4: uriGenerate

function uriGenerate($s, $sTable, $sField, $iMaxLen = 255)
{
    //$s = get_mb_replace ('/[^\pL^\pN]+/u', '-', $s); // unicode characters
    $s = get_mb_replace('/([^\\d^\\w]+)/', '-', $s);
    // latin characters
    $s = get_mb_replace('/([-^]+)/', '-', $s);
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // try to add date
    if (get_mb_len($s) > 240) {
        $s = get_mb_substr($s, 0, 240);
    }
    $s .= '-' . date('Y-m-d');
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // try to add number
    for ($i = 0; $i < 999; ++$i) {
        if (uriCheckUniq($s . '-' . $i, $sTable, $sField)) {
            return $s . '-' . $i;
        }
    }
    return rand(0, 999999999);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:25,代码来源:utils.inc.php


示例5: uriGenerate

function uriGenerate($s, $sTable, $sField, $sEmpty = '-')
{
    $s = uriFilter($s, $sEmpty);
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // cut off redundant part
    if (get_mb_len($s) > 240) {
        $s = get_mb_substr($s, 0, 240);
    }
    // try to add date
    $s .= '-' . date('Y-m-d');
    if (uriCheckUniq($s, $sTable, $sField)) {
        return $s;
    }
    // try to add number
    for ($i = 0; $i < 999; ++$i) {
        if (uriCheckUniq($s . '-' . $i, $sTable, $sField)) {
            return $s . '-' . $i;
        }
    }
    return rand(0, 999999999);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:23,代码来源:utils.inc.php


示例6: getCorrectUri

 function getCorrectUri($sCaption, $iOwnerId = 0, $bCheck = true)
 {
     $sUri = uriFilter($sCaption);
     if (!$sUri) {
         $sUri = '-';
     }
     if (!$bCheck) {
         return $sUri;
     }
     if ($this->checkUriUniq($sUri, $iOwnerId)) {
         return $sUri;
     }
     if (get_mb_len($sUri) > 240) {
         $sUri = get_mb_substr($sUri, 0, 240);
     }
     $sUri .= '-' . date('Y-m-d');
     if ($this->checkUriUniq($sUri, $iOwnerId)) {
         return $sUri;
     }
     for ($i = 0; $i < 999; ++$i) {
         if ($this->checkUriUniq($sUri . '-' . $i, $iOwnerId)) {
             return $sUri . '-' . $i;
         }
     }
     return time();
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:26,代码来源:BxDolAlbums.php



注:本文中的get_mb_substr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_media_embedded_in_content函数代码示例发布时间:2022-05-15
下一篇:
PHP get_mb_len函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap