日期:2014-05-17 浏览次数:20433 次
$a= array( array('category' => array('name'=>"第一级"),'children' => array( array('category' => array('name'=>"第二级"),'children' => array( array('category' => array('name'=>"第三级") ) ) ) ) ) ) ;
$a = array( array('category' => array('name'=>"第一级"),'children' => array( array('category' => array('name'=>"第二级"),'children' => array( array('category' => array('name'=>"第三级") ) ) ) ) ) ); function Breadcrumbs($ar) { foreach($ar as $row) { if(isset($row['category'])) echo $row['category']['name']; if(isset($row['children'])) { echo ' '; Breadcrumbs($row['children']); } } } Breadcrumbs($a);