Home  >  Article  >  Backend Development  >  PHP过滤★等特殊符号的正则_php技巧

PHP过滤★等特殊符号的正则_php技巧

WBOY
WBOYOriginal
2016-05-17 08:50:26954browse
复制代码 代码如下:

if(preg_match("/[ '.,:;*?~`!@#$%^&+=)({}]|\]|\[|\/|\\\|\"|\|/",$user)){
echo '不要在名字里面整些特殊符号,请只使用字母、数字和汉字,当然要你的浏览器要选简体中文GB2312哟,千万不要选繁体、中文HZ等。返回修改后,再来,我等你哟!';
exit();
}
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