http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">
汉字转换拼音
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;$i
160){
$q=ord(substr($str,++$i,1));
$p=$p*256+$q-65536;
}
$ret.=g($p);
}
return $ret;
}
if (isset($_POST['ok']) and strlen(trim($_POST['chinese']))>0) {
$str = $_POST['chinese'];
} else {
$str = "请输入你要转换的汉字";
}
echo "说明:将中文转换为拼音
";
echo c($str);
//echo c("");
//echo c("将中文转换为拼音");
?>