diff()
The diff() method compares with other arrays and returns the values that are not in any of the other arrays
<?php use kim\present\utils\arrays\ArrayUtils;
$arrayUtils = ArrayUtils::from(["first", "second", "third"]);
//General array comparison
$arrayUtils->diff(["first", "4th"]);
// expected output: ["second", "third"]Syntax
$arrayUtils->diff(iterable ...$iterables) : ArrayUtils;Parameter
$iterablesArrays to compare.
Return value
A array containing all the entries that are not present in any of the other arrays. (Keys are preserved)
Prefixing
References
Last updated