function getfirstchar($str){
if(empty($str)){
return '';
}
$fchar=ord($str{0});
if($fchar>=ord('a')&&$fchar return strtoupper($str{0});
}
$s1 = iconv('utf-8', 'gb18030',$str);
$s2 = iconv('gb18030','utf-8',$s1);
$s=$s2==$str?$s1:$str;
$asc=ord($s{0})*256+ord($s{1})-65536;
if($asc>=-20319&&$asc if($asc>=-20283&&$asc if($asc>=-19775&&$asc if($asc>=-19218&&$asc if($asc>=-18710&&$asc if($asc>=-18526&&$asc if($asc>=-18239&&$asc if($asc>=-17922&&$asc if($asc>=-17417&&$asc if($asc>=-16474&&$asc if($asc>=-16212&&$asc if($asc>=-15640&&$asc if($asc>=-15165&&$asc if($asc>=-14922&&$asc if($asc>=-14914&&$asc if($asc>=-14630&&$asc if($asc>=-14149&&$asc if($asc>=-14090&&$asc if($asc>=-13318&&$asc if($asc>=-12838&&$asc if($asc>=-12556&&$asc if($asc>=-11847&&$asc if($asc>=-11055&&$asc return null;
}
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
notic: [8] iconv(): detected an illegal character in input string d:\develop\upupw\htdocs\shixiapi\app\common\common\function.php 第 1157 行.
简单点就
$s1 = @iconv('UTF-8', 'GB18030',$str);$s2 = @iconv('GB18030','UTF-8',$s1); $s = mb_check_encoding($str, 'utf-8') ? iconv('utf-8', 'gbk', $str) : $str;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号