I have been trying to figure out how to populate a html template with data from a multi dimensional array, but i cant figure it out. The template is taken from MySQL.
This is what I have:
$template=addslashes($row['content']); eval("\$body=\"$template\";"); print($body);
Now the template is as follows:
$row['content'] = "<html><p>array item one $arr</p><p>array item two $arr</p></html>"
...and the array ($arr):
Array (  => Array (  => 1  => 6 ) )
The result is:
$body = <html><p>array item one Array</p><p>array item two Array</p></html>
...as opposed to what I expected:
$body = <html><p>array item one 1</p><p>array item two 6</p></html>
I can get this to work fine with 'solo variables' but it just wont return 'array variables'...
Anyone have any ideas where I am going wrong? I appologise in advance for my limited knowledge, im still learning. :)
Edited by NuGG: typo