I’m looking for a php preg replace to null/empty string if string contains any non alphanumeric characters or spaces
e.g. Strings
$string = "This string is ok";
$string = "Thi$ string is NOT ok, and should be emptied"
When I say emptied/nulled I mean it will make the string “”.
So basically anything a-z A-Z 0-9 or space is ok
Any ideas?
1 Answer