using preg_replace I want to allow only alphanumeric and spaces,
but ereg_replace("[^A-Za-z0-9\w\]
deletes all spaces.
What could I do in order to fix it?
Thanks in advance
you forgot a space
[^A-Za-z0-9\w\ ]
______________^
eg:
$returnValue = preg_replace('@[^A-Za-z0-9\w\ ]@', '', 'I forgot a %space!!!');
// I forgot a space
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With