note 15995 added to function.key

From: Date: Thu, 11 Oct 2001 16:46:41 +0000
Subject: note 15995 added to function.key
Groups: php.notes 
Request: Send a blank email to php-notes+get-18832@lists.php.net to get a copy of this message
In the case key() does not give you back the key(myarray) but "0", try this: (Try this example without the line containing "end($myarray)" and you see my reason for this post...) for($i = 0; $i <= 10; $i++) { $myarray[] = 'content '.$i; end($myarray); echo ('<br>key()='.key($myarray).' , content='.$myarray[$i]); } -- http://www.php.net/manual/en/function.key.php http://master.php.net/manage/user-notes.php?action=edit+15995 http://master.php.net/manage/user-notes.php?action=delete+15995 http://master.php.net/manage/user-notes.php?action=reject+15995

« previous php.notes (#18832) next »