标签 拼音

PHP汉字转拼音

PHP汉字转拼音

0&&$num<160){ return chr($num); } elseif($num<-20319||$num>-10247){
   return "";
}else{
   for($i=count($d)-1;$i>=0;$i--)
    {if($d[$i][1]<=$num)break;} return $d[$i][0]; } } function c($str){ $ret=""; for($i=0;$i160[......]

阅读全文»

用PHP把汉字转化为拼音

<?php
 $d=array(
  array("a",-20319),
  array("ai",-20317),
  array("an",-20304),
  array("ang",-20295),
  array("ao",-20292),
  array("ba",-20283),
  array("bai",-20265),
  array("ban",-20257),
  array("bang",-20242),
  array("bao",-20230),[......]

阅读全文»

PHP获取汉字拼音首字母

<?php 
function getfirstchar($s0){   
	$fchar = ord($s0{0});
	if($fchar >= ord("A") and $fchar <= ord("z") )return strtoupper($s0{0});
	$s1 = iconv("UTF-8","gb2312", $s0);
	$s2 = iconv("gb2312","UTF-8", $s1);
	if($s2 == $s0){$s = $s1;}else{[......]

阅读全文»

鄂ICP备13000209号-1