Results 1 to 3 of 3
Thread: Strip tease!
Jul 22, 2007, 13:41 #1
How can I strip all non-alphanumeric characters from a string? The characters I want to allow are:
Everything else can be stripped. How can this be done? Can anybody give me a hand with a regexp to do this?
Jul 22, 2007, 13:47 #2PHP Code:
$result = preg_replace('/[^\w\-]+/', '', $subject);
Logic without the fatal effects.
All code snippets are licensed under WTFPL.
Jul 22, 2007, 14:05 #3
Thank you very much! I hope you get a strip tease soon .