- mb_substr: documentation ( source)
<?php
//$utf8string = '测试杂志hello123等々';
$utf8string = '测试杂志';
//$utf8string = mb_substr('测试杂志', 0, 2, 'UTF-8');
$utf8string = mb_substr('Hello How are you志', 0, 2, 'UTF-8');
echo $utf8string;
//$var = 'hello123';
//$pos = strpos($utf8string, $var);
//if ($pos!==false) {
//echo substr($utf8string, 0, 10);
//}