PHP Manualarray_udiff(PHP 5) array_udiff — Computes the difference of arrays by using a callback function for data comparison Description
array array_udiff
( array $array1
, array $array2
[, array $ ...
], callback $data_compare_func
)
array_udiff() returns an array containing all the values of array1 that are not present in any of the other arguments. Note that keys are preserved. For the comparison of the data data_compare_func is used. It must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. This is unlike array_diff() which uses an internal function for comparing the data.
Example#1 array_udiff() example
<?phpThe above example will output:
See also array_diff(), array_diff_assoc(), array_diff_uassoc(), array_udiff_assoc(), array_udiff_uassoc(), array_intersect(), array_intersect_assoc(), array_uintersect(), array_uintersect_assoc() and array_uintersect_uassoc().
|
PHP-Index
New Tutorial entries
|






