title: How to create a nested array out of an array in PHP
body: <p>Say, we have an array: <code>array(1,2,3,4,...)</code>
  And I want to convert it to: </p>
  
  <pre><code>array(
      1=&gt;array(
          2=&gt;array(
              3=&gt;array(
                  4=&gt;array()
              )
          )
      )
  )
  </code></pre>
  
  <p>Can anybody help?<br>
  Thanks</p>
  
  <p><em>EDIT</em> It would be good to have the solution with iterations.</p>