[PHP] Re: Variables in Variables?

2005-11-18 Thread Ben
Marquez Design said the following on 11/18/2005 04:54 PM: Greetings. Does anyone know how to do this? I have, $var $var2 In a field called two_vars in a MySQL db. I am calling the variables inside PHP document. In that document I am saying: $var = time $var2 = clock !-- I do the query

Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene
Ben wrote: If I understand your question properly I'd explode $two_vars with whatever seperator you have between them and then you'll need to use eval to get your results. Maybe something like... $dbVars=explode(',',$two_vars); // Assuming comma seperator foreach($dbVars AS $key = $value) {

Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene
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