note 45562 added to function.key
| From: | al_the_x at yahoo dot com | Date: | Fri, 10 Sep 2004 19:03:28 +0000 |
| Subject: | note 45562 added to function.key | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76425@lists.php.net to get a copy of this message | ||
While this may go without saying for most of us, it is note-worthy that the value returned by key()
when called upon an empty array evaluates equal to the empty string. That is, in the following
example:
$newArray = array();
if (key($newArray) == "") echo "True";
else echo "False";
"True" is output.
Not rocket science, but omitted from the documentation above.
----
Manual Page -- http://www.php.net/manual/en/function.key.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45562
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45562&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45562&report=yes
Search -- http://master.php.net/manage/user-notes.php