note 77064 added to function.current
| From: | vaclav dot sir at gmail dot com | Date: | Mon, 13 Aug 2007 16:23:37 +0000 |
| Subject: | note 77064 added to function.current | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129449@lists.php.net to get a copy of this message | ||
To that "note": You won't be able to distinguish the end of an array from a boolean
FALSE element, BUT you can distinguish the end from a NULL value of the key() function.
Example:
<?php
if (key($array) === null) {
echo "You are in the end of the array.";
} else {
echo "Current element: " . current($array);
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 90.176.198.24
----
Manual Page -- http://www.php.net/manual/en/function.current.php
Edit -- https://master.php.net/note/edit/77064
Del: integrated -- https://master.php.net/note/delete/77064/integrated
Del: useless -- https://master.php.net/note/delete/77064/useless
Del: bad code -- https://master.php.net/note/delete/77064/bad+code
Del: spam -- https://master.php.net/note/delete/77064/spam
Del: non-english -- https://master.php.net/note/delete/77064/non-english
Del: in docs -- https://master.php.net/note/delete/77064/in+docs
Del: other reasons-- https://master.php.net/note/delete/77064
Reject -- https://master.php.net/note/reject/77064
Search -- https://master.php.net/manage/user-notes.php