我想從服務器端驗證表單數據。 我的興趣是用戶只需填寫波斯語字符。使用preg_match檢測字符串中的波斯語(波斯語)字符
我使用這個代碼:
$name=trim($_POST['name']);
$name= mysql_real_escape_string($name);
if (preg_match('/^[\u0600-\u06FF]+$/',str_replace("\\\\","",$name))){$err.= "Please use Persian characters!";}
,但它不工作!
這裏是一個警告:
Warning: preg_match() [function.preg-match]: Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 3 in C:\xampp\htdocs\site\form.php on line 38
我能做些什麼?