PHP array_diff_key() functionThis is an inbuilt function of PHP. This function was introduced in PHP 5.1. The array_diff_key() function compares the keys of two or more arrays, and returns entries from array1 that are not present in array2 or array3, etc. Syntax
Return TypeReturns an array containing the entries from array1 that are not present in any of the other arrays. Example 1Output: Array ( [3]=> Boi ) Example 2Output: Array( [20] => Laxman [30] => Rahul [40] => Ganguly [50] => Yuvi ) Example 3Output: Array ( [b] => Bed ) Example 4Output: Array ( [a1]=> red [c3]=> blue [d4]=> black )
Next TopicPHP Array Functions
|