utf8字符串截取
时间:2005-12-31 来源:放弃思考
村里看到的,不错的东东^_^
/**
* 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));
?>
/**
* 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));
?>
相关阅读 更多 +