By default, the qq account used by the website to register a new user is used to obtain the qq nickname as the user name. The Code $ user_array [& #039; member_name & #039;] $ qquser_info [& #039; nickname & #039;]; however, many QQ nicknames carry the symbol Mars, but website programs can only recognize numbers and Chinese characters... register a new user using qq
By default, qq nickname is obtained as the user name.
The Code is as follows:
$ User_array ['Member _ name'] = $ qquser_info ['nickname'];
However, many QQ nicknames contain symbols such as Mars, but website programs can only recognize numbers and Chinese characters,
How to filter the value of $ qquser_info ['nickname ']
Only the numbers and Chinese characters are retained.
For example, if the obtained QQ nickname is "fail", how can I filter the QQ nickname as "fail "?
Reply content:
Register a new user using qq
By default, qq nickname is obtained as the user name.
The Code is as follows:
$ User_array ['Member _ name'] = $ qquser_info ['nickname'];
However, many QQ nicknames contain symbols such as Mars, but website programs can only recognize numbers and Chinese characters,
How to filter the value of $ qquser_info ['nickname ']
Only the numbers and Chinese characters are retained.
For example, if the obtained QQ nickname is "fail", how can I filter the QQ nickname as "fail "?
$ Str = '* ^ % ☆ ☆as I am 123 then '; echo preg_replace ('| [^ a-zA-Z0-9 \ x {4e00}-\ x {9fa5}] | U', '', $ str );
Note,BytesThis character cannot be removed because it is a valid Chinese character.
The general practice is to first obtain the vertices of each word, and then determine whether the vertices are within the vertices range of Chinese characters or numbers. For the ranges of Chinese characters, see the link description.
Haha, I think it's right to let your website program recognize more content.
Try some pinyin libraries. It can be transferred. I don't know if I can meet duang.