RE: [PHP] email templates and str_replace

From: Date: Wed, 20 Jun 2001 19:58:26 +0000
Subject: RE: [PHP] email templates and str_replace
Groups: php.general 
Request: Send a blank email to php-general+get-54596@lists.php.net to get a copy of this message
> Richard, > The problem is with the str_replace()s. Consider the following: > > <?php > $myvar = 'this is a var.'; > $mytext = str_replace('is', 'is not', $myvar); > ?> > > At this point $myvar still equals 'this is a var.' but $mytext is 'this is > not a var.' $myvar hasn't been modfified by the str_replace so any > additional str_replace()s after it will not have a cumlative effect. Actually, wouldn't the string then be equal to 'this not is not a var.' ?? - Brian

« previous php.general (#54596) next »