Re: Re: Variables in Variables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jasper Bryant-Greene wrote:
Ben wrote:

$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key => $value) {
    $eval="\$temp=".$value.";";
    eval($eval);
    echo $temp;
}

WTF do you need eval() for?!

$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value ) {
    echo $value;
}

Ah, sorry, I see what I missed now... Still, I'm sure there's a way to do this without resorting to eval()...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux