macpaw/similar-arrays

Check is similar arrays

v1.0.2 2023-01-12 14:46 UTC

This package is auto-updated.

Last update: 2024-11-12 18:45:57 UTC


README

Installation

$ composer require macpaw/similar-arrays

Example

Simple how check similar two arrays:

$similarArray = new SimilarArray();
$result = $similarArray->isArraysSimilar(['test'], ['test']);
var_dump($result) // true

$result = $similarArray->isArraysSimilar(['test'], ['exit']);
var_dump($result) // false

How check signature value:

$similarArray = new SimilarArray();
$result = $similarArray->isArraysSimilar(['a' => '~\d+'], ['a' => 1111], ['a']);
var_dump($result) // true