PHP verification Chinese expression urgent !!!!!!! Php u9
How to use PHP to verify Chinese letters and numbers,
[\ U4E00-\ u9FA5] can I verify Chinese characters ????? Urgent
Reply to discussion (solution)
[\ X4E00-\ x9FA5]
It should be [\ x4E00-\ x9FCF]
Currently, most of the software supports unicode 6.1.
No. [\ u4E00-\ u9FA5] is used for js regular expressions.
Now that you want to use it like this, we can see that you are using UTF-8 encoding.
In php regular expressions, [\ x {4e00}-\ x {9fa5}] must be written with the u modifier.
However, with the u modifier, \ w contains Chinese characters.
It should be [\ x4E00-\ x9FCF]
Currently, most of the software supports unicode 6.1.
If (ereg ('^ [\ x4E00-\ x9FCF] {1,100} $', 'Hahaha only ')){
Echo "through ";
} Else {
Echo "error ";
}
?>
Or is it wrong,
No. [\ u4E00-\ u9FA5] is used for js regular expressions.
Now that you want to use it like this, we can see that you are using UTF-8 encoding.
In php regular expressions, [\ x {4e00}-\ x {9fa5}] must be written with the u modifier.
However, with the u modifier, \ w contains Chinese characters.
Gb2312 does not understand. js also uses gb2312.
The browser will unify all incoming data into unicode encoding, for simplified Chinese environment is UCS-2
And \ u4E00-\ u9FA5 is the encoding range of the Chinese character UCS-2
The browser will unify all incoming data into unicode encoding, for simplified Chinese environment is UCS-2
And \ u4E00-\ u9FA5 is the encoding range of the Chinese character UCS-2
Yes, you understand.
But you said I couldn't use it in eregi ().
If (eregi ()){
Ecjp 'true ';
}
Thank you !!!
Echo 'true ';
Is ereg supported ????
The ereg series uses POSIX regular expressions.
The preg series uses PCRE regular expressions.
The two are not compatible!
The ereg function Group will be abolished in the near future.
The ereg series uses POSIX regular expressions.
The preg series uses PCRE regular expressions.
The two are not compatible!
The ereg function Group will be abolished in the near future.
Thank you very much !!!