title: How to convert one dimensional array into nested <li>?
body: <p>How to convert a single dimension array into multi dimensional array or into a nested <code>&lt;li&gt;</code> HTML.</p>
  
  <p>Below is the array which I need in nested <code>&lt;li&gt;</code> based on <code>parent_id</code></p>
  
  <pre><code>Array (
  [5] =&gt; Array
      (
          [data_id] =&gt; 5
          [data_parent] =&gt; 4
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Assets
          [data_link] =&gt; 0
      )
  
  [57] =&gt; Array
      (
          [data_id] =&gt; 57
          [data_parent] =&gt; 5
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Fixed Assets
          [data_link] =&gt; 0
      )
  
  [52] =&gt; Array
      (
          [data_id] =&gt; 52
          [data_parent] =&gt; 5
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Asset Two
          [data_link] =&gt; 1
      )
  
  [51] =&gt; Array
      (
          [data_id] =&gt; 51
          [data_parent] =&gt; 5
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Assset ONE
          [data_link] =&gt; 1
      )
  
  [48] =&gt; Array
      (
          [data_id] =&gt; 48
          [data_parent] =&gt; 4
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Expenses
          [data_link] =&gt; 0
      )
  
  [50] =&gt; Array
      (
          [data_id] =&gt; 50
          [data_parent] =&gt; 48
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Expense One
          [data_link] =&gt; 1
      )
  
  [49] =&gt; Array
      (
          [data_id] =&gt; 49
          [data_parent] =&gt; 48
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Expense One
          [data_link] =&gt; 1
      )
  
  [58] =&gt; Array
      (
          [data_id] =&gt; 58
          [data_parent] =&gt; 57
          [data_level] =&gt; 
          [data_prefix] =&gt; 
          [data_title] =&gt; Vehicles
          [data_link] =&gt; 1
      )
  
  )
  </code></pre>