title: Read this multilevel array in parts PHP
body: <p>I will have this type of array in PHP:</p>
  
  <pre><code>$data = array(
      array(1 =&gt; array("A ROW GREENS", array(
          "A1" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
          "A2" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
          "A3" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg")
      ))),
      array(2 =&gt; array("A ROW BLUE",array(
          "A1" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
          "A2" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
          "A3" =&gt; array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg")
      ))),
  
  );
  </code></pre>
  
  <p>I will need to read it from parts.</p>
  
  <p>First part:<br>
  I need recover "A ROW GREENS", "A ROW BLUE".. and this level in this part.</p>
  
  <p>Second part:<br>
  I need here the A1,A2,A3,..... with the associateds url</p>
  
  <p>I tried split the parts with some for combinations without success.. Any help?</p>
  
  <pre><code>foreach($data as $key=&gt;$value){
      foreach($value as $main=&gt;$second){
          foreach($second as $seconda=&gt;$secondb){
  
          print_r($secondb);
          echo "&lt;br&gt;&lt;hr&gt;";
  
          }
      }
  }
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>&lt;ul id="parent"&gt;
      &lt;li id="1"&gt;A ROW GREENS&lt;/li&gt;
      &lt;li id="2"&gt;A ROW BLUE&lt;/li&gt;
  &lt;/ul&gt;
  ...
  </code></pre>
  
  <p>More later I need:</p>
  
  <pre><code>&lt;ul id="child1"&gt;
      &lt;li class="parent1"&gt;A1&lt;/li&gt;
      &lt;li class="parent1"&gt;A2&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul id="child2"&gt;
      &lt;li class="parent2"&gt;A1&lt;/li&gt;
      &lt;li class="parent2"&gt;A2&lt;/li&gt;
  &lt;/ul&gt;
  ...
  </code></pre>
  
  <p>Finally, other <code>&lt;ul&gt;</code> with the URLs, but these will be easy since I will have the second part.</p>
  
  <p>(Don't worry about the ids, it's only for the visual relations in the code)</p>