$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;
?>
其中
$name = preg_replace('/[\.\s+\?,\/"]/','_',$name); //change spaces
\.\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