Your three str_replace calls might be faster anyway...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Philip Murray <[EMAIL PROTECTED]>
Newsgroups: php.general
To: PHP General List <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:31 AM
Subject: Regular expressions


> In Perl you can do this:
>
>     $foo =~ tr/012/mpf/;
>
> Which is the same as:
>
>     $foo = str_replace("0", "m", $foo);
>     $foo = str_replace("1", "p", $foo);
>     $foo = str_replace("2", "f", $foo);
>
> in PHP.
>
> Is there a more elegant way of doing this in PHP? I tried preg_replace but
> it didn't seem to like my regexp.
>
> Any ideas?
>
> -------------------------------- -  -- -  -   -
> Philip Murray
> [EMAIL PROTECTED]
> ------------- -  -- -   -
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to