I have a question about eval function, i'm trying to read a tpl file line by line and convert the output to html, everything works fine except if the tpl contains two dimension array of variable my eval function fails to read the variable, following is an example :
Code: Select all
$temp["name"]["first"] = "Michael";
$temp["name"]["surname"] = "Lee";
$compile_line ='my name is $temp[name][first]';
the eval function here can work with any variables even with array but not with two dimention array !!
and please if you can explain how the eval function works, coz i just know the above eval function can read the variable out of a line, but does not know how it works ~