Hallo diplomsiedler,
Ersetze alle Vorkommnisse von "$template" durch "$str" oder umgekehrt, und dein Problem dürfte behoben sein.
Wie denn?
$template = str_replace("[NAME]",$name[$i],$str);
Ersetze in $str "[NAME]" durch $name[$i]
$template = str_replace("[merchantCategory]",$merchantCategory [$i],$template);
^^^^^^^^^
$template = str_replace("[offerID]",$offerID[$i],$template);
^^^^^^^^^
Überlege mal, wie Dein voriger Code reagiert hätte:
Ersetzung $str $template
[NAME] [NAME] [Category] [offerID] Hans [Category] [offerID]
[Category] [NAME] [Category] [offerID] [NAME] irgendeine [offerID]
[offerID] [NAME] [Category] [offerID] [NAME] [Category] 24678
Du musst natürlich immer mit dem Ergebnis der vorigen Ersetzung weitermachen, sonst kann es nicht funktionieren.
Christian
Hast Du einen Beitrag? Nur her damit!
http://aktuell.de.selfhtml.org/tippstricks/beitrag.htm
SELF-Code: (http://emmanuel.dammerer.at/selfcode.html)
sh:) fo:) ch:] rl:( br:> n4:& ie:% mo:) va:) de:] zu:) fl:( js:| ss:) ls:[