PHP » PYTHON |
login |
register |
about
|
|
array_udiff_assoc(PHP 5) array_udiff_assoc — Computes the difference of arrays with additional index check, compares data by a callback function Description
array array_udiff_assoc
( array $array1
, array $array2
[, array $ ...
], callback $data_compare_func
)
Computes the difference of arrays with additional index check, compares data by a callback function.
Parameters
Return Valuesarray_udiff_assoc() returns an array containing all the values from array1 that are not present in any of the other arguments. Note that the keys are used in the comparison unlike array_diff() and array_udiff(). The comparison of arrays' data is performed by using an user-supplied callback. In this aspect the behaviour is opposite to the behaviour of array_diff_assoc() which uses internal function for comparison. Examples
Example #1 array_udiff_assoc() example
<?phpThe above example will output:
Array
(
[0.1] => cr Object
(
[priv_member:private] => 9
)
[0.5] => cr Object
(
[priv_member:private] => 12
)
[0] => cr Object
(
[priv_member:private] => 23
)
)
In our example above you see the "1" => new cr(4) pair is present in both arrays and thus it is not in the ouput from the function. See Also
|
more
Recently updated
more
Most requested
more
Last requests
|