title: Tree menu expand and collapse using PHP
body: <p>I have following array:</p>
  
  <pre><code>$firstlevel=array(“numbers”,”vowels”,”animals”,”birds”);    
  $numbers=array(“one”,”two”,”three”);    
  $vowels= array (“a”,”e”,”i”,,”o”,”u”);    
  $animals=array(“lion”,”tiger”,”dog”,”wolf”,”horse”,”Zebra”);    
  $birds=array(“parrot”,”sparrow”,”crow”);
  </code></pre>
  
  <p>I need tree menu like below:(ONLY BY USING PHP)</p>
  
  <pre><code>+ numbers
  + vowels
  + animals
  + birds
  
   Reset button
  </code></pre>
  
  <p>When clicking it expands like following:</p>
  
  <pre><code>+ Fruits
  - Vegetables
    + Drumstick
    + Lady’s finger
  + Animals
  + Birds
  </code></pre>
  
  <p>The same format should be retain once we click on the other first level item its
  corresponding child nodes to be in expanded.</p>