<?php function chkword($word){ $mb_wordlen=mb_strlen($word, big5); for ($i=0; $i<$mb_wordlen; $i++){ $num='' $mb_len=mb_substr($word, $i, 1, big5); $wordlen=strlen($mb_len); for ($j=0; $j<$wordlen; $j++){ $len=substr($mb_len, $j, 1); $num.=Ord($len); if ($j==$wordlen-1){ if (($num>=163116 && $num<=163126) || ($num>=163161 && $num<=163186)){ $cls=1; break; } } } if ($cls)break; } return $cls; } //使用范例 if (chkword($word)){ echo "请勿使用注音文"; } ?>
月光论坛http://bbs.dj...com/