array_intersect_assoc(): Intersection of two or more arrays
$array1 : Required , the input array which will be checked. $array2 : Required , the value and key to be matched with $array1. Here keys are also used for comparison in addition to values. ( In array_intersect() only values are used for comparison ) Example with two arrays
Output is here.
Keys of the first index are retained. ( no re-indexing done here) . The third element is not included as the key is different in both arrays.
Example with three arrays
Output is here.
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
|