array_diff_key(): Difference between two arrays with respect to KeysThis function takes two or more arrays as input and then returns the result array as difference.
Returns all elements of $array1 which are not present in $array2 ($new_array=$array1 without $array2).... Here comparison is done based on the keys only ( NOT values ).
Example with two arrays
Output is here.
Keys of the first index are retained. ( no re-indexing done here)
This article is written by plus2net.com team.