note 21964 added to function.str-replace

From: Date: Sat, 01 Jun 2002 21:39:24 +0000
Subject: note 21964 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-31331@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); -- http://www.php.net/manual/en/function.str-replace.php http://master.php.net/manage/user-notes.php?action=edit+21964 http://master.php.net/manage/user-notes.php?action=delete+21964 http://master.php.net/manage/user-notes.php?action=reject+21964

« previous php.notes (#31331) next »