Friday, October 3, 2014

ฟังก์ชั่น PHP ตรวจสอบคำภาษาไทย(PHP Check Thai Word)

<?
function checkthai($word){
return preg_replace('/[^ก-๙]/u','',$word);
}
$checkthaiword=trim(checkthai('บันทึกข้อความ!!'));

if($checkthaiword != ""){ echo "มีภาษาไทย"; }

?>

No comments:

Post a Comment