ereg
| From: | Jason Soza | Date: | Fri, 03 May 2002 04:51:27 +0000 |
| Subject: | ereg | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-95822@lists.php.net to get a copy of this message | ||
Hoping someone can help me here. I'm working with someone else's code and
I'm not familiar with ereg_replace(), can someone provide me an alternative
to the following?
ereg_replace("[^a-z0-9._]", "",
ereg_replace (" ", "_",
ereg_replace("%20", "_",
strtolower($original_name))));
Basically, I want to enter $original_name and have it come out $new_name,
converting all spaces to underscores, upper to lowercase, and whatever that
first line does. :)
I've read through the manual and what I got was that preg_replace() is
probably faster... Anyhow, I looked up preg_replace() and as a newbie to
PHP, the given examples look like a language all their own.
Thanks,
Jason