how to get the value of my var, which double dollar var is set from multidimensional array?
<p>i managed to dynamically create my arrays (as <code>$$myGenre</code> contains each <code>name =&gt; id</code>), but <code>$myGenre</code> does not contain anything... how can i make this work : <code>$myGenre</code> should contain every <code>$$myGenre</code>, <code>$$myGenre</code> should have its content as <code>name =&gt; id</code>, and we should keep each <code>$myGenre</code> separated from one another (here, because of the <code>foreach</code>, we're overriding  <code>$myGenre</code> for each different genre) :</p>

<pre><code>&lt;?php function findSection() {
    global $post, $custom_meta_fields, $myGenre;
    foreach ($custom_meta_fields as $fields) {  

        foreach ($fields as $field) {

            if ($field == $fields['genre']) {

                $myGenre = array($field['title']);
                $$myGenre = array();

            } else {
                ${$myGenre}[$field['name']] = $field['id'];
            }
        }
        var_dump($$myGenre);
     }
}


$custom_meta_fields = array(
                            array( //THRILLER
                            'genre' =&gt; array( 'title' =&gt; 'Thriller'),
                            'fields' =&gt; array(
                                        'name' =&gt; 'Movie1',
                                        'desc' =&gt; 'Desc movie1',
                                        'id' =&gt; 'id1',
                                        'type' =&gt; 'text'),
                                        array(
                                            'name' =&gt; 'Movie2',
                                            'desc' =&gt; 'desc movie2',
                                            'id' =&gt; 'id2',
                                            'type' =&gt; 'text'
                                              ),
                                        array(
                                            'name'  =&gt; 'movie3',
                                            'desc'  =&gt; 'desc',
                                            'id'    =&gt; 'id3',
                                            'type'  =&gt; 'image'
                                            )
                            ),
                            array(
                                'genre' =&gt; array( 'title' =&gt; 'Action'),
                                'fields' =&gt;  array('name' =&gt; 'Action1',
                                           'desc' =&gt; 'desc act1',
                                           'id'   =&gt; 'idAction1')
                            )
                        );

findSection();
</code></pre>

<p>Thanks for your help</p>
