我想将字符串的非字母数字字符替换为空格.
我用了 $title= preg_replace("/[^a-zA-Z0-9\s]/", " ", $title);
$title= preg_replace("/[^a-zA-Z0-9\s]/", " ", $title);
所以当用户输入时
ABC!?d $
这将是
A B C D
但是由于用户将其输入到文本输入,它会转到"x.php?title = abc!?d $".我想要它去"x.php?title = abc + d",因为我想要"abc d","abc $$$$$$$$$ d","abc __.!d"等去同一个网址.我怎么能管理这个.谢谢.
php regex preg-replace
php ×1
preg-replace ×1
regex ×1