Any Chinese letters and numbers. But why can’t I pass Chinese when I try it? It has always been no. I can pass in English. Why is this?
if(preg_match("/^[a-z0-9\xa1-\xff]{1,8}$/",$username)){ echo "yes"; }else{ echo "no" }
preg_match() returns the number of matches for pattern. Its value will be 0 (no match) or 1 because preg_match() will stop searching after the first match. So aaa returning 'no' is normal.
aaa
/^[a-z0-9\u4e00-\u9fa5]{1,8}$/
http://m.111cn.net/art-42203.htm
preg_match() returns the number of matches for pattern. Its value will be 0 (no match) or 1 because preg_match() will stop searching after the first match. So
aaa
returning 'no' is normal.http://m.111cn.net/art-42203.htm