note 101732 added to function.array-values
| From: | Anonymous at osu1 dot php dot net | Date: | Fri, 07 Jan 2011 18:07:12 +0000 |
| Subject: | note 101732 added to function.array-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175518@lists.php.net to get a copy of this message | ||
Regarding flattening arrays:
I started from the top and worked down, testing the various examples on array flattening functions.
The best function of the ones I tested was this one:
http://www.php.net/manual/en/function.array-values.php#86190
It's the best because all others:
1) Didn't preserve ALL values(!) - probably due to keys being identical on diff. branches
of the tree...
and/or
2) Didn't preserve the ORDER of the values
This one does not overwrite values, and it keeps them in order.
I didn't test any further functions, so functions below that one might be even more brilliant.
=====================
BTW: I wish people would check their code better. Missing ';' or '$' is just
proof that the code has never been run, so it's either written from top-of-head, or debugged by
brain-power.
Would be nice if people actually RAN the code that they claim does this or that, because if
it's missing a dollar sign who knows what bugs might else be there?
Other than that - thnx for sharing!!!
----
Server IP: 69.147.83.197
Probable Submitter: 212.242.236.187
----
Manual Page -- http://www.php.net/manual/en/function.array-values.php
Edit -- https://master.php.net/note/edit/101732
Del: integrated -- https://master.php.net/note/delete/101732/integrated
Del: useless -- https://master.php.net/note/delete/101732/useless
Del: bad code -- https://master.php.net/note/delete/101732/bad+code
Del: spam -- https://master.php.net/note/delete/101732/spam
Del: non-english -- https://master.php.net/note/delete/101732/non-english
Del: in docs -- https://master.php.net/note/delete/101732/in+docs
Del: other reasons-- https://master.php.net/note/delete/101732
Reject -- https://master.php.net/note/reject/101732
Search -- https://master.php.net/manage/user-notes.php