Jesse: no, array_intersect_key does not accomplish the same
thing as what you posted:
array_flip (array_intersect (array_flip ($a), array_flip
($b)))
because when the array is flipped, values become keys.
having duplicate values is not a problem, but having
duplicate keys is. array_flip resolves it by keeping only
one of the duplicates and discarding the rest. by the time
you start intersecting, you've already lost information.
----
Server IP: 64.71.164.2
Probable Submitter: 137.99.177.212
----
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-interse
ct-key.php
Edit -- http://master.p
hp.net/note/edit/63797
Del: integrated -- ht
tp://master.php.net/note/delete/63797/integrated
Del: useless -- http:
//master.php.net/note/delete/63797/useless
Del: bad code -- http
://master.php.net/note/delete/63797/bad+code
Del: spam -- http://m
aster.php.net/note/delete/63797/spam
Del: non-english -- h
ttp://master.php.net/note/delete/63797/non-english
Del: in docs -- http:
//master.php.net/note/delete/63797/in+docs
Del: other reasons-- http://master
.php.net/note/delete/63797
Reject -- http://master
.php.net/note/reject/63797
Search -- http://ma
ster.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|