I am attempting to use multi-dimensional arrays to build menus. I have been able to list the menu items but I am not quite sure on how to go about adding the urls to both the main menu and submenus, any ideas on this would be helpful...
Here is the generic code using multi-dimensional arrays...
$navigation = array(
'Main1'=>array('m1_sub1', 'm1_sub2', 'm1_sub3', 'm1_sub4'),
'Main2'=>array('m2_sub1', 'm2_sub2', 'm2_sub3', 'm2_sub4'),
'Main3'=>array('m3_sub1', 'm3_sub2', 'm3_sub3', 'm3_sub4', 'm3_sub5', 'm3_sub6')
);
foreach($navigation as $arr=>$values)
{
//echo "$arr<br>";
echo "•";
echo "$arr<br>";
foreach($values as $val)
{
echo " - ";
echo $val;
echo "<br>";
}
}
Thanks for your time