Replace multiple php strings with the same solution. Copy the code as follows :? Php $ nameToday3 ?, Verycold; $ namestrtolower ($ name); $ namepreg_replace ([^ a-z0-9s], $ name); $ namepreg_replace ([. s +?,]
The code is as follows:
$ Name = 'Today 3? , Very/cold ';
$ Name = strtolower ($ name );
// $ Name = preg_replace ('/[^ a-z0-9 \ s]/', '', $ name );
$ Name = preg_replace ('/[\. \ s + \?, \/"]/',' _ ', $ Name); // change spaces
Echo $ name;
?>
Where
The code is as follows:
$ Name = preg_replace ('/[\. \ s + \?, \/"]/',' _ ', $ Name); // change spaces
\. \ S + \?, \/"Is a regular expression that indicates searching for. null characters? /"These five characters
Others can be added by yourself. you need to find the regular expression manual when adding them.
The http://www.bkjia.com/PHPjc/327694.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/327694.htmlTechArticle code is as follows :? Php $ name = 'Today 3? , Very/cold'; $ name = strtolower ($ name); // $ name = preg_replace ('/[^ a-z0-9 \ s]/', '', $ name ); $ name = preg_replace ('/[\. \ s + \?, \/"]/'...