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
Navigation:
[Reply to this message]
|