Converting eval code into ordinary php code
<p>Is it possible to have just normal php code and not use <code>eval()</code> function in such case?</p>

<p>My eval code is following:</p>

<pre><code>eval('$'.$var.'["'.$key.'"]="'.$value.'";');
</code></pre>

<p>And what I am doing is following:</p>

<pre><code>function config_update($array, $var="result")
{ 
    global $result, $dbi;

    while (list($key,$value)=each($array))
    {
        if (is_array($value))
        { 
            config_update($value, $var.'["'.$key.'"]'); 
        } 
        else
        { 
            for ($i=0; $i&lt;count($value);$i++)
            {
                if ($value == "{FROM_DB}")
                {
                    $query = $dbi-&gt;prepare("SELECT `value` FROM `".PRE."config` WHERE `key`=?;")-&gt;execute($key)-&gt;results();

                    if (!$query) 
                    {
                        trigger_error("There is no such key as `{$key}` in config database",E_USER_ERROR);
                        exit;
                    }
                    else
                        $value = str_replace("{FROM_DB}",$query[0]['value'],$value);
                }
                eval('$'.$var.'["'.$key.'"]="'.$value.'";');
                //$$var[$key] = $value; #smth like that..
            }
        }
    }
}
</code></pre>

<p>I basically need to update variable values with {FROM_DB} with values coming from DB.</p>
