note 21964 deleted from function.str-replace by torben

From: Date: Sat, 01 Jun 2002 21:43:28 +0000
Subject: note 21964 deleted from function.str-replace by torben
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-31334@lists.php.net to get a copy of this message
str_replace() does not like to be nested. This example generates an error: $xExp = "Example for Me to replace This."; $xStr = str_replace("Me","With",str_replace("This","That",$xExp)); You'll have to separate your statements like this: $xExp = "Example for Me to replace This."; $xStr = str_replace("Me","With",$xExp); $xStr = str_replace("This","That",$xStr);

« previous php.notes (#31334) next »