ereg_replace
| From: | Marc Logemann | Date: | Wed, 04 Jul 2001 14:54:56 +0000 |
| Subject: | ereg_replace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-56174@lists.php.net to get a copy of this message | ||
Hi,
short question:
i want to use ereg_replace to replace something with an array-element,
this is my code and its not working:
ereg_replace("<\\$([0-9])>", "\$parmarray[\\1]", $string);
parmarray is of course an array with some elements,
Here are the facts:
$parmarray = array ("", "value1", "value2");
$string = "foo <$1> bar <$2>";
output: foo $parmarray[1] bar $parmarray[2]
i want of course:
output: foo value1 bar value2
any ideas? thx in advance
-----------------------
Marc Logemann
Morelogs GmbH & Co. KG
Chief Software Architect
-----------------------