2011-04-05 121 views
0

你好如何訪問或回聲此關聯數組訪問關聯數組的每個值

 
Array 
(
    [0] => Array 
     (
      [rule] => admin/user 
      [title] => Users Management 
      [target] => _parent 
      [0] => Array 
       (
        [0] => Array 
         (
          [rule] => admin/user/add 
          [title] => Add New User 
         ) 

       ) 

     ) 

    [1] => Array 
     (
      [rule] => admin/category 
      [title] => Category Mangement 
      [target] => _parent 
      [0] => Array 
       (
        [0] => Array 
         (
          [rule] => admin/category/add 
          [title] => Add New Category 
         ) 

       ) 

     ) 

) 

我想知道哪個環路能支持本的每個元素和如何

+0

按什麼順序?你能舉一個你期望的輸出的例子嗎? – Nick 2011-04-05 11:38:36

回答

4

我假定使用array_walk_recursive(),有回調函數可以做回聲,這將是一個很好的解決方案。