title: PHP Bracket Array Within Key
body: <p>I currently have arrays with brackets within the arrays. i.e. <code>$variable[other[0]] = "something"</code>
  I would like a small function where it would check through $variable and see if there are brackets. If there are brackets, then remove that section and add it as a multidimensional array. Is this possible? Thanks!
  For example:</p>
  
  <pre><code>$variable = array(
      'test'      =&gt;  "test",
      'what'      =&gt;  "something else",
      'here[0]'   =&gt;  "yeah",
      'here[1]'   =&gt;  "weee"
  );
  print_r($variable);
  </code></pre>
  
  <p>This would output:</p>
  
  <pre><code>Array ( [test] =&gt; test [what] =&gt; something else [here[0]] =&gt; yeah [here[1]] =&gt; weee )
  </code></pre>
  
  <p>However, I would want it to run through a regex function and split up anything that had brackets and turn it into a multidimensional array.</p>
  
  <p>This would be the intended output:
  <code>Array ( [test] =&gt; test [what] =&gt; something else [here] =&gt; Array ( [0] =&gt; yeah [1] =&gt; weee ) )</code></p>