Skip to content

Instantly share code, notes, and snippets.

View lacri42's full-sized avatar

lacri lacri42

View GitHub Profile
@lacri42
lacri42 / safeRecursiveArrayAccess.php
Created August 18, 2016 16:25
This method checks if an array key exists recursively and returns its value on existence. Optionally validates the value against a callable.
<?php
/**
* This method checks if an array key exists recursively and returns its value on existence.
* Optionally validates the value against a callable.
*
* Example without callable:
* <code>
* $myArray = [
* "foo" => [
* "bar" => [