Using PHP to Transfer Chinese Character Into Pinyin?

If you want to transfer Chinese Character into pinyin, you can creat a php file, say hanzi2pinyin.php, and copy the following PHP code:
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){
$q=ord(substr($str,++$i,1));
$p=$p*256+$q-65536;
}
$ret.=g($p);
}
//$ret=ucfirst($ret);
return $ret;
}
echo c($_POST[‘hz’]);
?>

Input Chinese Character: