ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
Re: [PHP] ereg
by Jason Wong other posts by this author
May 3 2002 4:58AM messages near this date
[PHP] ereg | Re: [PHP] Re: How do I Install PHP on Apache 2, on win32
On Friday 03 May 2002 12:51, Jason Soza wrote:
>  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.

What you're doing is not particularly complicated and can be done using 
str_replace().

-- 
Jason Wong ->  Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
America, how can I write a holy litany in your silly mood?
		-- Allen Ginsberg
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Jason Soza
Jason Wong

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved