Consider this nested array:
$link = array(
'Level 1' => array(
'Monthly' => array(
'note' => 'Note 1 1',
'link' => '1.1.com',
),
'6 Month' => array(
'note' => 'Note 1 6',
'link' => '1.6.com',
),
),
'Level 2' => array(
'Monthly' => array(
'note' => 'Note 2.1',
'link' => '2.1.com',
),
'6 Month' => array(
'note' => 'Note 2.6',
'link' => '2.6.com',
),
),
How would I gracefully use a foreach
to achieve the following:
if $var = 'Level 1' output
<a href="1.1.com" title="Note 1 1">Monthly</a>
<a href="1.6.com" title="Note 1 6">6 Month</a>
I'm suspecting I might need to do a loop inside a loop? I can iterate through the array, but am having trouble figuring out how to call the name of the sub-array...