Stripping Characters
| From: | Rick Dwyer | Date: | Tue, 22 Jun 2010 15:40:32 +0000 |
| Subject: | Stripping Characters | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-306308@lists.php.net to get a copy of this message | ||
Hello List.
I need to remove characters from a string and replace them with and underscore.
So instead of having something like:
$moditem = str_replace("--","_","$mystring");
$moditem = str_replace("?","_","$mystring");
$moditem = str_replace("!","_","$mystring");
....etc.
For every possible character I can think of, is there a way to simply omit any character that is not an alpha character and not a number value from 0 to 9?
--Rick