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

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

WBOY
WBOYOriginal
2016-06-23 13:42:231171browse

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


回复讨论(解决方案)

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

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


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

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

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



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

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


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

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

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

Statement:
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