📜  php 用破折号替换空格 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:13.157000             🧑  作者: Mango

代码示例3
// Clean up multiple dashes or whitespaces
$string = preg_replace("/[\s-]+/", " ", $string);
// Convert whitespaces and underscore to dash
$string = preg_replace("/[\s_]/", "-", $string);