//函数,输入字符串,返回字符串前三字母
public function getStoreName($str){
$one = mb_substr($str, 0, 1, 'utf-8');
$two = mb_substr($str, 1, 2, 'utf-8');
$three = mb_substr($str, 2, 3, 'utf-8');

if(preg_match('/^[\x7f-\xff]+$/', $one)){
$one = getFirstCharter($one);
}
if(preg_match('/^[\x7f-\xff]+$/', $two)){
$two = getFirstCharter($two);
}
if(preg_match('/^[\x7f-\xff]+$/', $three)){
$three = getFirstCharter($three);
}

return $one.$two.$three;

}

好像有点问题