PHP - Preg_replace() make replacement with array value
Posted on 2011-02-17
I am trying to do another reg_exp thing
I have an array....
and an input string....
$string = "i like <like=\"yellow food\"> and i like <like=\"green food\">";
The replacement is done so that the output reads...
i like bananas amd i like peas
I have been trying to do this in one line in the preg_replace() but i dont seem to be able to do it correctly.
Does anyone have ideas or will i have to do it in two stages...