注音 漢語拼音 preg_split 正規劃切割

$Hupinyin = array(
‘ㄅ’=>’b’,’ㄆ’=>’p’,’ㄇ’=>’m’,’ㄈ’=>’f’
,’ㄉ’=>’d’,’ㄊ’=>’t’,’ㄋ’=>’n’,’ㄌ’=>’l’
,’ㄍ’=>’g’,’ㄎ’=>’k’,’ㄏ’=>’h’
,’ㄐ’=>’j’,’ㄑ’=>’q’,’ㄒ’=>’x’
,’ㄓ’=>’zh’,’ㄔ’=>’ch’,’ㄕ’=>’sh’,’ㄖ’=>’r’
,’ㄗ’=>’z’,’ㄘ’=>’c’,’ㄙ’=>’s’
,’ㄚ’=>’a’,’ㄛ’=>’o’,’ㄜ’=>’e’,’ㄝ’=>’e’
,’ㄞ’=>’ai’,’ㄟ’=>’ei’,’ㄠ’=>’ao’,’ㄡ’=>’ou’
,’ㄢ’=>’an’,’ㄣ’=>’en’,’ㄤ’=>’ang’,’ㄥ’=>’eng’
,’ㄦ’=>’er’
,’ㄧ’=>’i’,’ㄨ’=>’u’,’ㄩ’=>’u’
);
$word = “ㄢ";
foreach ($Hupinyin as $k => $v) {
if ($k == $word){
echo “$word = $v <br />\n";
}
}

$a=’000000000000023,886-0223584312,,300,8,2001,1,2,2,20061012164304,20061012164820;<br>000000000000023,886-0233221018,,300,8,2001,1,2,2,20061012164304,20061012164740′;
$a=preg_replace(“/(;<br>)/", ‘,’, $a);
$chars = preg_split(“/,/", $a,-1,PREG_SPLIT_DELIM_CAPTURE);
print_r($chars);

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *