功能:把中文字符串截取为数组
header("Content-type: text/html; charset=utf-8");
$str = '中国富强';
preg_match_all('/./u', $str, $strs);
var_dump(current($strs));
结果为:
array(4) { [0]=> string(3) "中" [1]=> string(3) "国" [2]=> string(3) "富" [3]=> string(3) "强" }
功能:把中文字符串截取为数组
header("Content-type: text/html; charset=utf-8");
$str = '中国富强';
preg_match_all('/./u', $str, $strs);
var_dump(current($strs));
结果为:
array(4) { [0]=> string(3) "中" [1]=> string(3) "国" [2]=> string(3) "富" [3]=> string(3) "强" }