str_replace and arrays
| From: | Gerard Samuel | Date: | Thu, 06 Sep 2001 05:10:15 +0000 |
| Subject: | str_replace and arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-66150@lists.php.net to get a copy of this message | ||
Hey all. Im trying to reduce some lines of code that has muliple lines of str_replace. I figure lets try using arrays but its not working.
E.g. I have about 15-20 lines like this.
$message = str_replace(":D", "<IMG SRC=\"images/forum/icons/icon_biggrin.gif\">", $message);
Im trying
$path = "images/forum/icons/";
$one = array(":D",":)");
$two = array("$path"."icon_biggrin.gif", "$path"."icon_smile.gif");
message = str_replace($one, $two, $message);
do you see anything wrong....