title: Convert an array to multidimensional array
body: <p>I have an array that looks something like this:</p>
  
  <pre><code>array:2 [
      "test1_test2_test3" =&gt; "result"
      "category_slug" =&gt; "the_slug"
  ]
  </code></pre>
  
  <p>What I need to do is convert it to a multidimensional array that would look something like this:</p>
  
  <pre><code>array:2 [
      "test1" =&gt; [
          "test2" =&gt; [
              "test3" =&gt; "result"
          ]
      ]
      "category" =&gt; [
          "slug" =&gt; "the_slug"
      ]
  ]
  </code></pre>
  
  <p>I know that I can <code>explode</code> on the key to get an array but am unsure of how to then go from this to end up with the final result.</p>
  
  <p><strong>EDIT</strong> The array looks like that initially because it's being pulled from request parameters: <code>http://url.com?test1.test2.test3=result&amp;category.slug=the_slug</code> and Laravel auto converts it to an array.</p>