note 79345 added to function.next
| From: | gigs at gigstaggart dot com | Date: | Thu, 22 Nov 2007 02:22:09 +0000 |
| Subject: | note 79345 added to function.next | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132475@lists.php.net to get a copy of this message | ||
To GPatmore, I wrote a function almost just like yours to skip the last element when outputting
something like CSV...
It doesn't always work... I would think it wouldn't work at all and would cause the loop
to skip every other element, but it doesn't.
next() inside foreach instead returns false on some elements that may not be the last one... I
don't know the cause yet. But don't do that. It's not safe. :)
----
Server IP: 69.147.83.197
Probable Submitter: 71.63.105.172
----
Manual Page -- http://www.php.net/manual/en/function.next.php
Edit -- https://master.php.net/note/edit/79345
Del: integrated -- https://master.php.net/note/delete/79345/integrated
Del: useless -- https://master.php.net/note/delete/79345/useless
Del: bad code -- https://master.php.net/note/delete/79345/bad+code
Del: spam -- https://master.php.net/note/delete/79345/spam
Del: non-english -- https://master.php.net/note/delete/79345/non-english
Del: in docs -- https://master.php.net/note/delete/79345/in+docs
Del: other reasons-- https://master.php.net/note/delete/79345
Reject -- https://master.php.net/note/reject/79345
Search -- https://master.php.net/manage/user-notes.php