I need to perform a replacement action on a piece of HTML code width "[" brackets "]" denoting what should be replaced.
I'm not having any problem identifying the replacements in the HTML, the problem is rather that I have an array of variables that should be replaced as follows:
$strHTML="<b>[Replacement]</b>";
$array["Replacement"]="Replaced";
ereg_replace("([)(+.)(])",$array[\2],$strHTML);
I know that \2 contains "Replacement" but I cant seem to use it as an array key to retrieve the correct value.
Please help, or explain why I can't get it to work.