array_intersect_key(): Intersection of two or more arrays considering keys only
$array1 : Required , the input array which will be checked. $array2 : Required , the keys to be matched with $array1. Here keys are only used for comparison. ( 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
|