macpaw / similar-arrays
Check is similar arrays
Installs: 131 082
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^7.5 || ^8.5 || ^9.5
- slevomat/coding-standard: ^7.0
- squizlabs/php_codesniffer: ^3.6
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