dev-master
9999999-devChecks whether two arrays contain equal elements.
MIT
The Development Requires
v1.0.0
1.0.0.0Checks whether two arrays contain equal elements.
MIT
The Development Requires
Wallogit.com
2017 © Pedro PelĂĄez
Checks whether two arrays contain equal elements.
Allows to compare arrays., (*1)
By default this method checks whether two arrays contain equal elements by strict comparison (===). ``` php ArrayComparator::arraysHoldEqualElements([1, 2, 3], [1, 2, 3]); //true ArrayComparator::arraysHoldEqualElements([1, 2, 3], [1, 2, 3, 4]); //false ArrayComparator::arraysHoldEqualElements([1, 2, 3], [1, 3, 2]); //true, (*2)
But it's also possible to provide custom value compare function.
``` php
ArrayComparator::arraysHoldEqualElements(
[1, 2, 3],
[2, 4, 6],
function ($arr1Elem, $arr2Elem) {
return ((2 * $arr1Elem) === $arr2Elem);
}
); //true
Use composer to get the latest version:, (*3)
$ composer require lukaszmakuch/array-utils-comparator
Checks whether two arrays contain equal elements.
MIT
Checks whether two arrays contain equal elements.
MIT