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+?,/"]/'. ..
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