 <p>If you have associative array than You can use php built in function <code>extract()</code>. </p> <p>Example:</p> <pre><code>$abc = array('var1'=&gt;2, 'var2'=&gt;4, 'var3'=&gt;6); extract($abc); echo $var1.$var2.$var3; //Outputs 246 </code></pre>