我正在尝试自动化我的导航链接。如何自动回显foreach
。我现在得到未定义的偏移量......我可以忽略数组中的第一项(即标题)吗?
'control' => array( 0=>'Controls',
1=> array('Add school','add.school.php'),
2=> array('Add doctor','add.doctor.php'),
3=> array('Add playgroup','add.play.php'),
4=> array('Suggestions','suggestion.php'),
5=> array('List tutor service','list.tutor.php'),
6=> array('Create playgroup','create.play.php'),
7=> array('Dashboard', 'dashboard.php')
),
<?php
foreach ($nav['control'] as $value=>$key){
echo'<a href="'.$key[2].'">'.$key[1].'</a>';
}
?>