诚然博客

  • 首页
  • HTML
  • Jquery
  • PHP
  • ThinkPHP
  • Linux
  • 琐事
PHP
PHP

php 获取汉字首字母

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; $val=ord…

2015年3月23日 1675点热度 诚然 阅读全文
12

COPYRIGHT © 2012-现在 诚然博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

鄂ICP备2022012104号