Re: assoc array question

From: Date: Thu, 15 Aug 2002 21:47:31 +0000
Subject: Re: assoc array question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-112864@lists.php.net to get a copy of this message
aha!! array_keys !!! "Brian V Bonini" <b-bonini@cox.net> wrote in message news:LOBBKHJGOJFPJMLKAHKFGEAHGBAB.b-bonini@cox.net... > Off teeh top of my novice head I think count() or sizeof() is what your > looking for. > > > -----Original Message----- > > From: Alexander Ross [mailto:alexross@bleen.net] > > Sent: Thursday, August 15, 2002 5:23 PM > > To: php-general@lists.php.net > > Subject: [PHP] assoc array question > > > > > > I have this: (note that $info is an Assoc Array > > > > while (list ($key, $val) = each ($info)) > > { > > do stuff > > } > > > > I would like to do slightly different stuff if I'm at the very first, or > > very last item in the array. How do I do this. Below is the pseudo code > > which would be ideal: > > > > while (list ($key, $val) = each ($info)) > > { > > if(onFirstKey or onLastKey) > > do fun stuff > > else > > do other stuff > > } > > > > Please help. Thanks > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

« previous php.general (#112864) next »