title: Build Array Tree from URLs
body: <p>I need to build an tree (with arrays) from given urls.</p>
  
  <p>I have the following list of urls:</p>
  
  <pre><code>http://domain.com/a/a.jsp
  http://domain.com/a/b/a.jsp
  http://domain.com/a/b/b.jsp
  http://domain.com/a/b/c.jsp
  http://domain.com/a/c/1.jsp
  http://domain.com/a/d/2.jsp
  http://domain.com/a/d/a/2.jsp
  </code></pre>
  
  <p>now i need an array like this:</p>
  
  <pre><code>domain.com
    a
      a.jsp
      b
        a.jsp
        b.jsp
        c.jsp
      c
        1.jsp
      d
        2.jsp
        a
          2.jsp
  </code></pre>
  
  <p>How can i do this with php?</p>