dev-master
9999999-devChecks if the given keys or indices exists in the array
MIT
The Requires
- php >=5.6
The Development Requires
by Sebastian Kroczek
Checks if the given keys or indices exists in the array
Just like the php array_key_exists function but with the possibility to give multiple keys (path)., (*2)
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*3)
$ composer require sk/array_path_exists "dev-master"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*4)
After installing the library the function is autoloaded by the composer autoloader., (*5)
<?php require_once __DIR__.'/vendor/autoload.php'; $array = [ 'foo' => [ 'bar' => [ 'baz' => null ], ] ]; var_dump(array_path_exists($array, 'foo', 'bar', 'baz')); // Print `true`
For more examples see test file under tests/ArrayPathExistsTest.php, (*6)
The test suite is executed by running phpunit, (*7)
vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/
Issues and feature requests are handled on github. If you found a bug, you are always welcome to open an issue. And also feel free to create a pull request with a fix. Same for feature requests., (*8)
This library is under the MIT license. See the complete license in the library LICENSE file., (*9)
Checks if the given keys or indices exists in the array
MIT