Re: [PHP] replacing chars in input

2004-03-23 Thread Michal Migurski
>I want to end up with > > A-Za-z0-9_- > >(letters, numbers, underscore and dash). > >If there isn't a handy character class waiting for me, what must I do to >get those chars replaced? $out = preg_replace('/\W+/', '', $in); ---

[PHP] replacing chars in input

2004-03-23 Thread David T-G
Hi, all -- I would like to make things easier for my users and replace all of the garbage characters `'";:[EMAIL PROTECTED]&*()[]{}<>/?\|+= plus white space (\s) with underscores in the input. I am, however, having trouble getting my regexp to work. I can comfortably do $i = preg_replace(