标签: php regex arabic
如何在php中使用正则表达式匹配阿拉伯字母
我的代码
$name = $_GET("name"); if (arabic letters only and spaces) // using regexp
答案 0 :(得分:10)
我认为你的答案在这里: Check the language of string based on glyphs in PHP
if(preg_match("/\p{Arabic}/u", $name])) { echo 'valid'; }