quick fix | No Comments | February 12th, 2009
A regex that will check for any characters that are not in the list below and return true if any unknown characters are found
a-z
A-Z
0-9
_ (under-dash)
- (hypen)
(space)
$text = preg_replace(‘/[^a-zA-Z0-9_ -]/s’, ”, $text);