title: How to convert a Single Array into a multidimensional array in PHP?
body: <p>So I have an array that looks like this:</p>
  
  <pre><code>[98] =&gt; Array
  (
      [City] =&gt; Caracas
      [Country] =&gt; Venezuela
      [Continent] =&gt; Latin America
  )
  
  [99] =&gt; Array
  (
      [City] =&gt; Cairo
      [Country] =&gt; Egypt
      [Continent] =&gt; Middle East
  )
  
  [105] =&gt; Array
  (
      [City] =&gt; Abu Dhabi
      [Country] =&gt; United Arab Emirates
      [Continent] =&gt; Middle East
  )
  
  [106] =&gt; Array
  (
      [City] =&gt; Dubai
      [Country] =&gt; United Arab Emirates
      [Continent] =&gt; Middle East
  )
  
  [107] =&gt; Array
  (
      [City] =&gt; Montreal
      [Country] =&gt; Canada
      [Continent] =&gt; North America
  )
  </code></pre>
  
  <p>I am trying to sort this array into a multi-dimensional array, so that it outputs something like:</p>
  
  <pre><code>Continent
      - Country Name    
        -- Cities under Every Country
  </code></pre>
  
  <p>I am using PHP. Can anyone point me to a good starting point as to how I should go about doing this?</p>