//获取整条字符串(非纯汉字链)首个汉字拼音首字母
function pinyin_long2($zh)
{
$ret = "";
$s1 = iconv("UTF-8", "gb2312", $zh);
$s2 = iconv("gb2312", "UTF-8", $s1);
if ($s2 == $zh) {
$zh = $s1;
}
for ($i = 0; $i < strlen($zh); $i++) {
$s1 = substr($zh, $i, 1);
$p = ord($s1);
if ($p > 160) {
$s2 = substr($zh, $i++, 2);
$ret = getFirstCharters($s2);
} else {
$ret = $s1;
}
}
return $ret;
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询