PHP array_diff_assoc() functionThe array_diff_assoc() function is used to compare an array against another array and returns the difference. In other words, we can say that array_diff_assoc() function compares the keys and values of two or more arrays and return an array that contains the entries from array1 that are not present in array2 or array3. This function was introduced in PHP 4.3. Syntax
Return TypeReturns an array containing all the values from array1 that are not present in any of the other arrays. Example 1Output: Array ( [2] => green [3] => blue [4] => black ) Example 2Output: Array ( [b] => mango ) Example 3Output: Array ( [a] => orange [b] => mango [c] => banana ) Example 4Output: Array( [3]=> Array ( [4] => black ) )
Next TopicPHP Array Functions
|