PHP » PYTHON |
login |
register |
about
|
|
array_diff_uassoc(PHP 5) array_diff_uassoc — Computes the difference of arrays with additional index check which is performed by a user supplied callback function Description
array array_diff_uassoc
( array $array1
, array $array2
[, array $...
], callback $key_compare_func
)
Compares array1 against array2 and returns the difference. Unlike array_diff() the array keys are used in the comparision. Unlike array_diff_assoc() an user supplied callback function is used for the indices comparision, not internal function. Parameters
Return ValuesReturns an array containing all the entries from array1 that are not present in any of the other arrays. Examples
Example #1 array_diff_uassoc() example The "a" => "green" pair is present in both arrays and thus it is not in the ouput from the function. Unlike this, the pair 0 => "red" is in the ouput because in the second argument "red" has key which is 1.
<?phpThe above example will output:
Array
(
[b] => brown
[c] => blue
[0] => red
)
The equality of 2 indices is checked by the user supplied callback function.
Notes
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|