Background notes:
My local development environment is 5.5, the actual operating environment is 5.2 (no choice ... )。
Now the same regular match code
preg_match("/^[A-Za-z0-9\x{4e00}-\x{9fa5}]+$/u",$name)
5.5 can be used normally, 5.2 not.
Probably tested a bit, as if it were the/U modifier.
Check out some information,/U in Linux under the PHP4. X supported the UH.
Is there anything wrong with the 5.2 setting?
Reply content:
Background notes:
My local development environment is 5.5, the actual operating environment is 5.2 (no choice ... )。
Now the same regular match code
preg_match("/^[A-Za-z0-9\x{4e00}-\x{9fa5}]+$/u",$name)
5.5 can be used normally, 5.2 not.
Probably tested a bit, as if it were the/U modifier.
Check out some information,/U in Linux under the PHP4. X supported the UH.
Is there anything wrong with the 5.2 setting?
It should not be a version or syntax problem, but u mode cannot match the Chinese of the GBK character set, so if you confirm that the encoding setting of the character set used by the current page is determined to be utf-8, I can't think of any other reason. See if there are any more masters.