Adding malayalam language in regular expression in php
- by admin
- 0
Suppose we need to check $name in malayalm and english , Then add malayalam checking as below
if (preg_match(‘/^[\p{Malayalam}&\-\’. 0-9]+$/u’, $name)) {
return true;
} else {
return false;
}
Details of language code:
http://www.regular-expressions.info/unicode.html
Suppose we need to check $name in malayalm and english , Then add malayalam checking as below if (preg_match(‘/^[\p{Malayalam}&\-\’. 0-9]+$/u’, $name)) { return true; } else { return false; } Details of language code: http://www.regular-expressions.info/unicode.html
Suppose we need to check $name in malayalm and english , Then add malayalam checking as below if (preg_match(‘/^[\p{Malayalam}&\-\’. 0-9]+$/u’, $name)) { return true; } else { return false; } Details of language code: http://www.regular-expressions.info/unicode.html