Been searching around for good PHP help forums for a long time, let's hope this is the one that will bring me the most help.
Ok, well I'm developing a PHP template system, allowing the passing of variables and functions in its own unique way, similar to Smarty.
My issue at the moment, is preventing me from passing dynamic variables. Here is an example of a array call through the template system.
Code: Select all
[core.post.register_nickname]Code: Select all
$var_split = explode('.', $arg);
foreach($var_split as $var)
{
if($count == 0)
{
$echo = $this->vars[$var];
}
else
{
if($echo[$var])
{
$echo = $echo[$var];
}
else
{
if($var)
{
$echo = $echo['\'' . preg_replace('/{(.*?)}/i', "$\\1", $var) . '\''];
}
}
}
$count++;
}
But, my issue lies here:
Code: Select all
$echo = $echo['\'' . preg_replace('/{(.*?)}/i', "$\\1", $var) . '\''];If anyone could analyse the code and see if you could come up with a solution I'd be extremely grateful.
Thanks,
Nick.