Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
preg_replace を使用して、英数字とスペースのみを許可したいのですが、 ereg_replace("[^A-Za-z0-9\w\] すべてのスペースを削除します。
ereg_replace("[^A-Za-z0-9\w\]
修正するにはどうすればよいですか?
前もって感謝します
スペースを忘れた
[^A-Za-z0-9\w\ ] ______________^
例えば:
$returnValue = preg_replace('@[^A-Za-z0-9\w\ ]@', '', 'I forgot a %space!!!'); // I forgot a space