RE: [PHP] Array difficulty
| From: | Chris Boget | Date: | Tue, 31 Jul 2007 14:02:35 +0000 |
| Subject: | RE: [PHP] Array difficulty | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259909@lists.php.net to get a copy of this message | ||
> > Couldn't you just do
> > arsort($chance);
> > $lastItem = chance[( count( $chance ) - 1 )];
> $lastItem = end( $chance );
end() returns the value as well. You would also need to use key().
thnx,
Chris