note 68890 added to function.array-flip
| From: | dave at dtracorp dot com | Date: | Tue, 15 Aug 2006 02:10:27 +0000 |
| Subject: | note 68890 added to function.array-flip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115920@lists.php.net to get a copy of this message | ||
just a quick note on egingell at sisna dot com's possible structure
the function does not actually return a value, it actually sets the incoming array value
eg.
$arr = new array('a' => 1, 'b' => 2);
print_r(array_flip($arr));
will give you
Array
(
[1] => a
[2] => b
)
no need for
$newArray = array_flip($arr);
which would be the preferred usage i believe
----
Server IP: 203.220.0.234
Probable Submitter: 203.2.133.74 (proxied: 192.168.3.35)
----
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.array-flip.php
Edit -- https://master.php.net/note/edit/68890
Del: integrated -- https://master.php.net/note/delete/68890/integrated
Del: useless -- https://master.php.net/note/delete/68890/useless
Del: bad code -- https://master.php.net/note/delete/68890/bad+code
Del: spam -- https://master.php.net/note/delete/68890/spam
Del: non-english -- https://master.php.net/note/delete/68890/non-english
Del: in docs -- https://master.php.net/note/delete/68890/in+docs
Del: other reasons-- https://master.php.net/note/delete/68890
Reject -- https://master.php.net/note/reject/68890
Search -- https://master.php.net/manage/user-notes.php