note 3134 modified in sizeof by ronabop
| From: | ronabop@php.net | Date: | Wed, 18 Oct 2000 05:25:57 +0000 |
| Subject: | note 3134 modified in sizeof by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6641@lists.php.net to get a copy of this message | ||
If some elements in your array are not set, then sizeof() and count() will not return the index of
the last element, but will return the number of set elements. To find the index of the last element
in the array:
end($yourArray);
$index = key($yourArray);
... Where $yourArray is the array you want to find the last index ($index) of.
http://www.php.net/manual/function.sizeof.php