PHP arrays & variable variables
<p>With an array <code>$s_filters</code> that looks like this (many different keys possible):</p>

<pre><code>Array
(
    [genders] =&gt; m
    [ages] =&gt; 11-12,13-15
)
</code></pre>

<p>How can I programatically convert this array to this:</p>

<pre><code>$gender = array('m');
$ages = array('11-12','13-15');
</code></pre>

<p>So basically loop through <code>$s_filters</code> and create new arrays the names of which is the key and the values should explode on <code>","</code>;</p>

<p>I tried using variable variables:</p>

<pre><code>foreach( $s_filters as $key =&gt; $value )
{
    $$key = array();
    $$key[] = $value;
    print_r($$key);
}
</code></pre>

<p>But this gives me <code>cannot use [] for reading</code> errors. Am I on the right track?</p>
