utf8字符串截取
时间:2006-01-24 来源:cnscn2008
[来源]
http://wleige.cublog.cn
/**
* Filename : String.php
* Author : Dummy | Zandy
* Email :
[email protected]
| hotmail.com
* Create : 200512
* LastMod : 2005
* Usage :
*/
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
class String {
function subString_UTF8($str, $start, $lenth)
{
$len = strlen($str);
$r = array();
$n = 0;
$m = 0;
for($i = 0; $i = $lenth){
break;
}
}
}
return $r;
} // End subString_UTF8
}// End String
echo '';
echo join('', String::subString_UTF8('中国汉字'', 0, 1));
?>
http://wleige.cublog.cn
/**
* Filename : String.php
* Author : Dummy | Zandy
* Email :
[email protected]
| hotmail.com
* Create : 200512
* LastMod : 2005
* Usage :
*/
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
class String {
function subString_UTF8($str, $start, $lenth)
{
$len = strlen($str);
$r = array();
$n = 0;
$m = 0;
for($i = 0; $i = $lenth){
break;
}
}
}
return $r;
} // End subString_UTF8
}// End String
echo '';
echo join('', String::subString_UTF8('中国汉字'', 0, 1));
?>
相关阅读 更多 +