How can i Match arabic letters using regexp in php

前端 未结 1 1766
深忆病人
深忆病人 2021-01-19 04:11

How can i Match arabic letters with regexp in php

My Code

$name = $_GET(\"name\");

if (arabic letters only and spaces) // using regexp
1条回答
  •  余生分开走
    2021-01-19 04:35

    I think your answer is here: Check the language of string based on glyphs in PHP

    if(preg_match("/\p{Arabic}/u", $name])) {
    echo 'valid';
    } 
    

    0 讨论(0)
提交回复
热议问题