RE: [PHP] Empty elements in array

From: Date: Tue, 01 Aug 2000 07:32:39 +0000
Subject: RE: [PHP] Empty elements in array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9359@lists.php.net to get a copy of this message
Why the comma before $v in the example below? Noor -----Original Message----- From: php-general-return-9332-noor=comrax.com@lists.php.net [mailto:php-general-return-9332-noor=comrax.com@lists.php.net]On Behalf Of Rasmus Lerdorf Sent: eai uieue 01 aaaane 2000 03:34 To: Tim Cc: php-general@lists.php.net Subject: Re: [PHP] Empty elements in array > I have five elements in an array, and I have a while loop acting on the > array. However, I only want the non-empty elements to be processed by the > while loop - how do I tell it to ignore the empty elements? > > Thanks in advance for any help... :o) while(list(,$v)=each($array)) { if($v) { do something } } -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#9359) next »