PHP U9
How to use PHP to verify Chinese letters and numbers,
[\U4E00-\U9FA5] This can be verified in Chinese????? Tokyu
Reply to discussion (solution)
[\x4e00-\x9fa5]
It should be [\X4E00-\X9FCF]
Now the software basically supports the Unicode 6.1 version, can not use the old three
No, [\u4e00-\u9fa5] is the JS regular use
Now that you think of it, you're using a utf-8 code.
PHP regular writing [\x{4e00}-\x{9fa5}] plus u modifier
But now that you have the U modifier, \w already contains Chinese.
It should be [\X4E00-\X9FCF]
Now the software basically supports the Unicode 6.1 version, can not use the old three
if (Ereg (' ^[\x4e00-\x9fcf]{1,100}$ ', ' haha haha only ')) {
echo "Pass";
}else{
echo "Error";
}
?>
Or is it wrong?
No, [\u4e00-\u9fa5] is the JS regular use
Now that you think of it, you're using a utf-8 code.
PHP regular writing [\x{4e00}-\x{9fa5}] plus u modifier
But now that you have the U modifier, \w already contains Chinese.
gb2312 not understand JS also use is gb2312
The browser unifies all incoming data into Unicode encoding, which is ucs-2 for the Simplified Chinese environment.
And \u4e00-\u9fa5 is the Ucs-2 encoding range of Chinese characters.
The browser unifies all incoming data into Unicode encoding, which is ucs-2 for the Simplified Chinese environment.
And \u4e00-\u9fa5 is the Ucs-2 encoding range of Chinese characters.
Yes, I understand.
But you said I couldn't use it in Eregi.
if (eregi ()) {
Ecjp ' right ';
}
Thank you!!!
Echo ' right ';
Is Ereg supported????
The Ereg series uses the POSIX regular
The Preg series uses the PCRE regular
They are not compatible!
and the Ereg function group will be abolished in the near future, it is recommended not to use
The Ereg series uses the POSIX regular
The Preg series uses the PCRE regular
They are not compatible!
and the Ereg function group will be abolished in the near future, it is recommended not to use
Thank you very much!!!