So i'm trying to do the following and it's not working. not sure why:
$block = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php " . $this->compile_var(\\1) . " ?>", $block);
What i'm using that for is to turn this input:
<link href="{VAR_TEMPLATE_PATH}css/common.css" rel="stylesheet" type="text/css">
into:
<link href="<?php $this->page_vars["TEMPLATE_PATH"] ?>css/common.css" rel="stylesheet" type="text/css">
The actual conversion is fine, thats all contained in compile_var, but preg_replace is no longer turning \\1 into "VAR_TEMPLATE_PATH", which is used to do when inside a string.
Instead it is passing "\1" as the argument for compile_var?
Why is this happening all of a sudden? and how can i fix it?
Cheers!