Forum Moderators: coopster
I've been trying to figure this one out for a few hours and I'm not making much headway. Hoping someone here knows the quick solution...
I'd like to replace all characters in a string except for the set of keyboard characters. I figure this can probably be done with a preg_replace and some regex, but I'm afraid I need to bone up on my regex some...
If anyone here has any suggestions they'd be greatly appreciated.
Thanks!
[:alpha:], [:alnum:], [:print:], [:space:], etc.
So what you're looking for might be something like:
$text = eregi_replace ("[^[:print:]]", "", $text);