Reply to Re: creating variables in a loop

Your name:

Reply:


Posted by gosha bine on 06/04/07 18:41

Damo wrote:
> Hi,
> I want to create variables in a loop, each with a different name. Here
> is the loop i'm using:
>
>
> if (is_array($attribs)) {
> echo "Attributes : <br />";
> while(list($key,$val) = each($attribs)) {
> echo $key."has the value".$val."<br>";
>
> }
> }
>
> I want to create a variable with the name of each $key and contain the
> value in $val.
> Is this possible?
>

Possible (see http://www.php.net/manual/en/function.extract.php) but
pretty pointless. What's wrong with just array?


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

[Back to original 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

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