note 108184 added to function.array-flip
| From: | Anonymous | Date: | Thu, 05 Apr 2012 10:17:19 +0000 |
| Subject: | note 108184 added to function.array-flip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186982@lists.php.net to get a copy of this message | ||
Similarly, if you want the last value without affecting the pointer, you can do:
<?php
$array = array("one","two","three");
echo next($array); // "two"
$last = array_pop(array_keys(array_flip($array)));
echo $last; // "three"
echo current($array); // "two"
?>
----
Server IP: 208.69.120.55
Probable Submitter: 66.90.144.143
----
Manual Page -- http://www.php.net/manual/en/function.array-flip.php
Edit -- https://master.php.net/note/edit/108184
Del: integrated -- https://master.php.net/note/delete/108184/integrated
Del: useless -- https://master.php.net/note/delete/108184/useless
Del: bad code -- https://master.php.net/note/delete/108184/bad+code
Del: spam -- https://master.php.net/note/delete/108184/spam
Del: non-english -- https://master.php.net/note/delete/108184/non-english
Del: in docs -- https://master.php.net/note/delete/108184/in+docs
Del: other reasons-- https://master.php.net/note/delete/108184
Reject -- https://master.php.net/note/reject/108184
Search -- https://master.php.net/manage/user-notes.php