Re: question abput While (list

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: question abput While (list
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21653@lists.php.net to get a copy of this message
On Sun, 22 Oct 2000, Cybercandy Ltd wrote: > I've been busting my poor meager brain over this and can't understand this > line of > code please can someone explain to me what it means!? > > while (list(,$line) = each($incoming)) { I use (list($key,$line)=each($dbresult)), and that basically means that you take each line of the array $dbresult( consisting of a key and data), and assigning it to $key and $line. It is simply a way of assigning two variables at a time. From the manual: list Like array(), this is not really a function, but a language construct. list() is used to assign a list of variables in one operation. -- Morten Dreier Institutt for Datateknikk og Informasjonsvitenskap http://www.ifi.ntnu.no/~mdreier/

« previous php.general (#21653) next »