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"
}
大家讲道理2017-05-16 13:17:42
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.