str_replace

From: Date: Fri, 27 Dec 2002 00:24:42 +0000
Subject: str_replace
Groups: php.general 
Request: Send a blank email to php-general+get-129393@lists.php.net to get a copy of this message
All, In using str_replace, I glanced at the manual and found that it can take arrays for it's arguments. Great! I thought that I could have a single search string, an array of replacement vars, and no subject. It would then replace each successive instance of the search string with the next element in the replacement array. Sadly this is not the case. Anyone have any recommendations on how to go about this? Best idea using p/ereg_replace? Or just a loop system in which I replace the first instance of the string each time? I'm not great at p/ereg yet, anyone have any pointers? Cheers, Wes

« previous php.general (#129393) next »