Current Location: Home> Function Categories> array_intersect_assoc

array_intersect_assoc

Compute the intersection of arrays with index check
Name:array_intersect_assoc
Category:Array
Programming Language:php
One-line Description:Compare arrays, return intersections (compare key names and key values).

Definition and usage

The array_intersect_assoc() function is used to compare the key names and key values ​​of two (or more) arrays and return the intersection.

The function compares the key names and key values ​​of two (or more) arrays and returns an intersection array that includes all key names and key values ​​in the array being compared ( array1 ) and also in any other parameter array ( array2 or array3 , etc.).

illustrate

array_intersect_assoc() function returns an array of intersections of two or more arrays.

Unlike the array_intersect() function, this function compares key names in addition to comparing key values. The key names of elements in the returned array remain unchanged.

grammar

 array_intersect_assoc ( array1 , array2 , array3 ... )
parameter describe
array1 Required. The first array that is compared with other arrays.
array2 Required. The array that compares to the first array.
array3 ,... Optional. Other arrays that are compared with the first array.
Similar Functions
Popular Articles