★ wanayoo — archive 1999 http://www.php.net/manual/function.array-intersect.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Arrays
Quick Reference
Japanese version of this pageHungarian version of this page
Arrays
* array
* array_count_values
* array_diff
* array_flip
* array_intersect
* array_keys
* array_merge
* array_merge_recursive
* array_multisort
* array_pad
* array_pop
* array_push
* array_rand
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unique
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* key
* krsort
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: array_intersect
View the source code for this pageSearch the site



Previous page
 array_flip
 Updated
Wed, 09 Aug 2000
array_keys 
Next page


array_intersect

(PHP4 >= 4.0.1)

array_intersect -- Computes the intersection of arrays

Description

array array_intersect (array array1, array array2 [, array ...])

Array_intersect() returns an array containing all the values of array1 that are present in all the arguments. Note that keys are preserved.

Example 1. Array_intersect() example


$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");
$result = array_intersect ($array1, $array2);
      

This makes $result have array ("a" => "green", "red");

See also array_diff().


 About Notes


Previous page
 array_flip
 Updated
Wed, 09 Aug 2000
array_keys 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.