Forum Moderators: coopster
$out_string = preg_replace("/\W+/", "_", $in_string);
Here [php.net] is a useful site for this kind of thing.
[edited by: coopster at 2:32 pm (utc) on Aug. 31, 2007]
[edit reason] changed link to authoritative domain [/edit]