You are here: Re: [PHP] Re: Variables in Variables? « PHP « IT news, forums, messages
Re: [PHP] Re: Variables in Variables?

Posted by Jasper Bryant-Greene on 10/09/81 11:32

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) {
> $eval="\$temp=".$value.";";
> eval($eval);
> echo $temp;
> }

WTF do you need eval() for?!

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

.... does exactly the same thing.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация