1 " . myMbSubstr($str, 0, 7, "utf8") . "";20 echo mb_substr($str, 0, 7, "utf8");21 ?>
输出
array(1) { [0]=> array(8) { [0]=> string(1) "I" [1]=> string(1) "'" [2]=> string(1) "m" [3]=> string(1) " " [4]=> string(1) "a" [5]=> string(1) " " [6]=> string(3) "码" [7]=> string(3) "农" } }
I'm a 码I'm a 码