📌  相关文章
📜  删除php代码示例中的特殊字符

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

代码示例6
function removeSpecialChar($string) 
        {
            $string = strtolower($string);
            $string = preg_replace('/[^\da-z ]/i', '', $string);// Removes special chars.
            $string = str_replace(' ', '-', $string); // Replaces all spaces with underscore.
            return strtolower($string);
        }