12-03-2009, 02:28 AM
|
#1 (permalink)
|
|
The Contributor
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
|
Stripping non alpha numeric characters
This should work correct?
PHP Code:
ereg_replace('[^A-Za-z]','', $str);
Because I am using it on a project that I need to strip any characters that are not alpha numeric, or if the string contains dash's or underscores that is ok too. But I can add that in later. I guess my problem is that It's not stripping '^' or '#'. I'm sure there are more characters its letting through. But those are the ones I've noticed so far.
__________________
|
|
|