2017 © Pedro PelĂĄez
 

library array-utils-comparator

Checks whether two arrays contain equal elements.

image

lukaszmakuch/array-utils-comparator

Checks whether two arrays contain equal elements.

  • Saturday, August 22, 2015
  • by lukaszmakuch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 38 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ArrayComparator

Allows to compare arrays., (*1)

Usage

arraysHoldEqualElements

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

Installation

Use composer to get the latest version:, (*3)

$ composer require lukaszmakuch/array-utils-comparator

The Versions

22/08 2015

dev-master

9999999-dev

Checks whether two arrays contain equal elements.

  Sources   Download

MIT

The Development Requires

22/08 2015

v1.0.0

1.0.0.0

Checks whether two arrays contain equal elements.

  Sources   Download

MIT

The Development Requires