Home > Backend Development > PHP Tutorial > php怎么过滤掉智能ABC打出来的V11

php怎么过滤掉智能ABC打出来的V11

WBOY
Release: 2016-06-23 13:42:23
Original
1182 people have browsed it

就是空格,这个空格识别不了,ctype_space和preg_replace('/\s\s+/','',$nick)==''都不行,就是全部是那种空白不允许写入数据库。
 


回复讨论(解决方案)

只能ABC v11 打出来的是全角空格

只能ABC v11 打出来的是全角空格


哦,就是说无法用正则过滤,只能用replace强行过滤是吗

$nick = preg_replace('/\s| /', '', $nick);
Copy after login
Copy after login
Copy after login

$nick = preg_replace('/\s| /', '', $nick);
Copy after login
Copy after login
Copy after login



可以,测试通过,大侠你是不是手动在后面用智能abc打了个v11?

$nick = preg_replace('/\s| /', '', $nick);
Copy after login
Copy after login
Copy after login


是打了智能abc的v11进去正则的。

$a = ' ';$b = ' ';echo base64_encode($a).'<br>'; // 44CAecho base64_encode($b); // IA==
Copy after login

嗯,很巧妙的解决方法,完美解决了我的难题,谢谢

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template