复制代码 代码如下:function chineseFirst($str){ $str= iconv(“UTF-8″,”gb2312”, $str); //如果程序是gbk的,此行就要注释掉 //判断字符串是否全都是中文 if (preg_match(“/^[\x7f-\xff]/”, $str)) { $fchar=ord($str{0}); if($fchar>=ord(“A”) and $fchar<=ord(“z”) )return strtoupper($str{0}); $a = $str;