PHP 8.5.0 Alpha 4 available for testing

Voting

: max(five, six)?
(Example: nine)

The Note You're Voting On

james dot PLZNOSPAM at bush dot cc
8 years ago
If you want a simple way to show values that are in either array, but not both, you can use this:

<?php
function arrayDiff($A, $B) {
$intersect = array_intersect($A, $B);
return
array_merge(array_diff($A, $intersect), array_diff($B, $intersect));
}
?>

If you want to account for keys, use array_diff_assoc() instead; and if you want to remove empty values, use array_filter().

<< Back to user notes page

To Top