note 69092 added to function.reset
| From: | dionyzizatdeviantart dot com at osu1 dot php dot net | Date: | Tue, 22 Aug 2006 21:39:54 +0000 |
| Subject: | note 69092 added to function.reset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116183@lists.php.net to get a copy of this message | ||
alreece45 at yahoo dot com's each() did not work in my tests. I had to check the return value
of current(), instead.
<?php
function rotate(&$array) {
$item = current($array);
if ($item === false) {
reset($array);
$item = current($array);
if ($item === false) {
// array is empty
return false;
}
}
return $item;
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 68.124.53.122
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.reset.php
Edit -- https://master.php.net/note/edit/69092
Del: integrated -- https://master.php.net/note/delete/69092/integrated
Del: useless -- https://master.php.net/note/delete/69092/useless
Del: bad code -- https://master.php.net/note/delete/69092/bad+code
Del: spam -- https://master.php.net/note/delete/69092/spam
Del: non-english -- https://master.php.net/note/delete/69092/non-english
Del: in docs -- https://master.php.net/note/delete/69092/in+docs
Del: other reasons-- https://master.php.net/note/delete/69092
Reject -- https://master.php.net/note/reject/69092
Search -- https://master.php.net/manage/user-notes.php