Re: checking if any values in one array are in another
| From: | Jochem Maas | Date: | Mon, 12 Jun 2006 16:24:07 +0000 |
| Subject: | Re: checking if any values in one array are in another | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237820@lists.php.net to get a copy of this message | ||
Jay Blanchard wrote:
> [snip]
> Is there a single php function that will tell me if any values in one
> array
> are in another without looping through one of the arrays and doing
> in_array?
> [/snip]
>
> You have read http://www.php.net/array right?
rtm? thats for wimps ;-)
> http://www.php.net/manual/en/function.array-intersect-assoc.php
there is also:
http://www.php.net/manual/en/function.array-intersect.php
for pure value intersection, and this:
http://www.php.net/manual/en/function.array-intersect.php
for pure key intersection.
and then there are a host of similar funcs that use user defined callbacks to
perform the comparison for whether keys &/or are values are considered the
same.
>