Re: preg_replace() ??

From: Date: Fri, 01 Mar 2002 15:59:12 +0000
Subject: Re: preg_replace() ??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-86782@lists.php.net to get a copy of this message
On Friday, March 1, 2002, at 10:34 AM, Erik Price wrote:
On Thursday, February 28, 2002, at 10:33 PM, Monty wrote:
Is preg_replace() the best PHP command to use for parsing custom codes in text retrieved from a database (e.g., turning "[link= ]" into "<a href= >")?
Use preg only if you need the power of regexes. If you are just looking to replace certain predefined strings with other strings, then you should use substr() it's faster.
Whoops, I meant str_replace() ! ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#86782) next »