PHP variable not defined inside while loop
<p>I have a PHP variable thats value is set at the start of my document but when I use my WHILE LOOP it get UNDEFINED and stops working.</p>

<p>Can anyone help how to keep this value assigned?</p>

<p>The variable I'm trying to keep defined is $lang</p>

<pre><code>$lang = "en";// base url


function getAccountDeliveryDetails($id){
    $query  = "SELECT * FROM tbl_user_delivery WHERE user_id = '$id'";
    $result = mysql_query($query);

    while($row = mysql_fetch_array($result)){
    $phrase =   array(  
                            'de'    =&gt;  'Bearbeiten',
                            'en'    =&gt;  'Edit',
                            'es'    =&gt;  'Editar',
                            'fr'    =&gt;  'Éditer',
                            'it'    =&gt;  'Modifica');
                        echo $phrase[$lang];
    }   
}
</code></pre>
