Copy code The code is as follows:
$name = 'Today 3?, very/ cold';
$name = strtolower($name);
//$name = preg_replace('/[^a-z0-9s]/','',$name);
$name = preg_replace(' /[.s+?,/"]/','_',$name); //change spaces
echo $name;
?>
where
Copy code The code is as follows:
$name = preg_replace('/[.s+?,/"]/','_' ,$name); //change spaces
.s+?,/" is a regular expression, indicating search. Empty symbol ? / / " These five characters
and others can be added by yourself. When searching for the regular manual
http://www.bkjia.com/PHPjc/327694.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327694.htmlTechArticleCopy the code as follows: ?php $name = 'Today 3? , very/ cold'; $name = strtolower ($name); //$name = preg_replace('/[^a-z0-9s]/','',$name); $name = preg_replace('/[.s+?,/"]/'. ..