Im trying to work out how to get the value from one setting in an array.
When i do this
<?php
$data = array($settings);
echo "<pre>";
echo print_r($data);
echo "</pre>";
?>
I get this ( but i dont want to just spit the array out like below )
Array
(
[0] => Array
(
[layout] => pizza:simple
[style] => pizza:red
)
)
1
I tried this but no luck ( What i need is just the value of layout or style )
<?php
$data = array($settings);
$layout = $data->layout;
?>
So basically i can now use the $layout value for things i want to do on the page.
How do i do this please?
Thanks in advance 🙂
jonny
$data[0]['layout']or$data[0]['style']This is an associative array so its basically an array inside of an array. So if you had another value 1 it could have a different layout and pizza and it would be accessed by $data[1][‘layout’] etc