Re: Question on foreach()?

From: Date: Fri, 14 Jul 2000 16:44:46 +0000
Subject: Re: Question on foreach()?
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-24557@lists.php.net to get a copy of this message
ugly, you have to access the array twice, first in the foreach loop, and second when using the array index. why not good old `while (list ($k,$v) = each ($arr)){}' instead for this ?
Sometimes I don´t store anything but TRUE as an arrays value, eg. that kicks of every duplicate and as said sometimes arrays from a db are stored in associative arrays containing field information as a key and you could not need the value... reagards -- o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° · 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . · | psychedelic experience | gott@kiffen.de | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·

« previous php.dev (#24557) next »