Does it exist any function to dynamically create variables from the key value pair of an array?
<p>Let's say I have this array,</p>

<pre><code>$array = array(
    'name' =&gt; 'hermet',
    'emails' =&gt; array ('hermet@example.com',
                     'hermet@example.net');
);
</code></pre>

<p>So this way <code>echo $array ['name'] == 'hermet'</code> prints true. I would like to know if there is a function already embedded in PHP that let me do this:</p>

<pre><code>echo $name == 'hermet'; // obviously 'false'

foreach ($array as $key =&gt; $value) {
    $aux = $key;
    $$aux = $value; 
}   

echo $name == 'hermet'; // now prints 'true'
</code></pre>

<p>It seems to work even with a multidimensional array but I don't know if PHP has already any function to do that.</p>

<p>Thank you in advance.</p>
