array_intersect_assoc
Compute the intersection of arrays with index check
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.).
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.
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. |