title: create a unlimited multilevel nested list from a recursive array
body: <p>Can anyone please assist me with the logic of looping through a recursive array and creating a multi level nested list using php. I have not been very successful in getting beyond the top level list nodes.</p>
  
  <p>please see array below:</p>
  
  <pre><code>Dump =&gt; array(6) {
    [0] =&gt; array(5) {
      ["id"] =&gt; string(1) "1"
      ["label"] =&gt; string(13) "address types"
      ["slug"] =&gt; string(17) "admin/addresstype"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(false)
    }
    [1] =&gt; array(5) {
      ["id"] =&gt; string(1) "3"
      ["label"] =&gt; string(9) "dashboard"
      ["slug"] =&gt; string(15) "admin/dashboard"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(false)
    }
    [2] =&gt; array(6) {
      ["id"] =&gt; string(1) "5"
      ["label"] =&gt; string(16) "feature category"
      ["slug"] =&gt; string(21) "admin/featurecategory"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(true)
      ["children"] =&gt; array(2) {
        [0] =&gt; array(6) {
          ["id"] =&gt; string(1) "4"
          ["label"] =&gt; string(7) "feature"
          ["slug"] =&gt; string(13) "admin/feature"
          ["parent_id"] =&gt; string(1) "5"
          ["has_children"] =&gt; bool(true)
          ["children"] =&gt; array(2) {
            [0] =&gt; array(5) {
              ["id"] =&gt; string(1) "2"
              ["label"] =&gt; string(6) "status"
              ["slug"] =&gt; string(12) "admin/status"
              ["parent_id"] =&gt; string(1) "4"
              ["has_children"] =&gt; bool(false)
            }
            [1] =&gt; array(5) {
              ["id"] =&gt; string(1) "7"
              ["label"] =&gt; string(4) "menu"
              ["slug"] =&gt; string(10) "admin/menu"
              ["parent_id"] =&gt; string(1) "4"
              ["has_children"] =&gt; bool(false)
            }
          }
        }
        [1] =&gt; array(5) {
          ["id"] =&gt; string(1) "9"
          ["label"] =&gt; string(17) "subscription type"
          ["slug"] =&gt; string(22) "admin/subscriptiontype"
          ["parent_id"] =&gt; string(1) "5"
          ["has_children"] =&gt; bool(false)
        }
      }
    }
    [3] =&gt; array(5) {
      ["id"] =&gt; string(1) "6"
      ["label"] =&gt; string(8) "industry"
      ["slug"] =&gt; string(14) "admin/industry"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(false)
    }
    [4] =&gt; array(5) {
      ["id"] =&gt; string(1) "8"
      ["label"] =&gt; string(12) "subscription"
      ["slug"] =&gt; string(18) "admin/subscription"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(false)
    }
    [5] =&gt; array(5) {
      ["id"] =&gt; string(2) "10"
      ["label"] =&gt; string(4) "user"
      ["slug"] =&gt; string(10) "admin/user"
      ["parent_id"] =&gt; string(1) "0"
      ["has_children"] =&gt; bool(false)
    }
  }
  </code></pre>
  
  <p>Many thanks in advance</p>