Home  >  Article  >  Backend Development  >  PHP filter ★ and other special symbols regular_PHP tutorial

PHP filter ★ and other special symbols regular_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:39:50805browse

Copy code The code is as follows:

if(preg_match("/[ '.,:;*?~`!@#$% ^&+=)(<>{}]|]|[|/|\|"||/",$user)){
echo 'Do not include special symbols in the name, please only use For letters, numbers and Chinese characters, of course your browser must select Simplified Chinese GB2312, do not select Traditional Chinese, Chinese HZ, etc. Return and modify, I will wait for you! ';
exit();
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/728102.htmlTechArticleCopy the code as follows: if(preg_match("/[ '.,:;*?~`!@# $%^lt;{}]|]|[|/|\|"||/",$user)){ echo 'Do not include special symbols in the name. Please only use letters, numbers and Chinese characters.. .
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