I'm having a problem using a variable from preg_replace. Basically what I want to achieve is to look for some patterns in a text, and replace them by content. The replacement is done in a seperate function (retrieveValue() ). However I'm having difficulties passing the variable ('$1').
$types = array(
array(
'/\*#(.*?)#\*/',
$this->retrieveValue($templateVars,'$1')
)
);
foreach ($types as $type) {
$template = preg_replace($type[0], $type[1], $template);
}