本文整理汇总了PHP中utf8_strspn函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_strspn函数的具体用法?PHP utf8_strspn怎么用?PHP utf8_strspn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了utf8_strspn函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: strspn
/**
* UTF-8 aware alternative to strspn
* Find length of initial segment matching mask
*
* @param string $str The haystack
* @param string $mask The mask
* @param integer $start Start optional
* @param integer $length Length optional
*
* @return integer
*
* @see http://www.php.net/strspn
* @since 11.1
*/
public static function strspn($str, $mask, $start = null, $length = null)
{
jimport('phputf8.strspn');
if ($start === null && $length === null) {
return utf8_strspn($str, $mask);
} elseif ($length === null) {
return utf8_strspn($str, $mask, $start);
} else {
return utf8_strspn($str, $mask, $start, $length);
}
}
开发者ID:nogsus,项目名称:joomla-platform,代码行数:25,代码来源:string.php
示例2: strspn
/**
* UTF-8 aware alternative to strspn
* Find length of initial segment matching mask
*
* @static
* @access public
* @param string the haystack
* @param string the mask
* @param int start optional
* @param int length optional
* @see http://www.php.net/strspn
*/
public static function strspn($str, $mask, $start = NULL, $length = NULL)
{
jimport('phputf8.strspn');
if ($start === FALSE && $length === FALSE) {
return utf8_strspn($str, $mask);
} else {
if ($length === FALSE) {
return utf8_strspn($str, $mask, $start);
} else {
return utf8_strspn($str, $mask, $start, $length);
}
}
}
开发者ID:joebushi,项目名称:joomla,代码行数:25,代码来源:string.php
示例3: strspn
/**
* UTF-8 aware alternative to strspn
* Find length of initial segment matching mask
*
* @param string $str The haystack
* @param string $mask The mask
* @param integer $start Start optional
* @param integer $length Length optional
*
* @return integer
*
* @see http://www.php.net/strspn
* @since 2.0
*/
public static function strspn($str, $mask, $start = null, $length = null)
{
if (!function_exists('utf8_strspn')) {
require_once __DIR__ . '/phputf8/strspn.php';
}
if ($start === null && $length === null) {
return utf8_strspn($str, $mask);
}
if ($length === null) {
return utf8_strspn($str, $mask, $start);
}
return utf8_strspn($str, $mask, $start, $length);
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:27,代码来源:Utf8String.php
示例4: strspn
/**
* UTF-8 aware alternative to strspn
* Find length of initial segment matching mask
*
* @param string $str The haystack
* @param string $mask The mask
* @param integer $start Start optional
* @param integer $length Length optional
*
* @return integer
*
* @see http://www.php.net/strspn
* @since 1.0
*/
public static function strspn($str, $mask, $start = null, $length = null)
{
require_once __DIR__ . '/phputf8/strspn.php';
if ($start === null && $length === null) {
return utf8_strspn($str, $mask);
} elseif ($length === null) {
return utf8_strspn($str, $mask, $start);
} else {
return utf8_strspn($str, $mask, $start, $length);
}
}
开发者ID:ZerGabriel,项目名称:joomla-framework,代码行数:25,代码来源:String.php
示例5: strspn
/**
* UTF-8 aware alternative to strspn()
*
* Find length of initial segment matching mask.
*
* @param string $str The haystack
* @param string $mask The mask
* @param integer $start Start optional
* @param integer $length Length optional
*
* @return integer
*
* @see http://www.php.net/strspn
* @since 1.3.0
*/
public static function strspn($str, $mask, $start = null, $length = null)
{
if ($start === null && $length === null) {
return utf8_strspn($str, $mask);
}
if ($length === null) {
return utf8_strspn($str, $mask, $start);
}
return utf8_strspn($str, $mask, $start, $length);
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:25,代码来源:StringHelper.php
示例6: testLinefeedMask
function testLinefeedMask()
{
$str = "iñtërnât\niônàlizætiøn";
$this->assertEqual(utf8_strspn($str, "âëiônñrt\n"), 12);
}
开发者ID:kidwellj,项目名称:scuttle,代码行数:5,代码来源:utf8_strspn.test.php
注:本文中的utf8_strspn函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论