0
使用preg_replace我想只允許字母數字和空格, 但ereg_replace("[^A-Za-z0-9\w\]
刪除所有空格。PHP ereg_replace允許空格
我能做些什麼來解決它?
在此先感謝
使用preg_replace我想只允許字母數字和空格, 但ereg_replace("[^A-Za-z0-9\w\]
刪除所有空格。PHP ereg_replace允許空格
我能做些什麼來解決它?
在此先感謝
你忘了空間
[^A-Za-z0-9\w\ ]
______________^
如:
$returnValue = preg_replace('@[^A-Za-z0-9\w\ ]@', '', 'I forgot a %space!!!');
// I forgot a space
對陣'[\ W \ S]'匹配非字母,非空格字符。 – 2012-08-15 16:59:07