src/Core/Base.php
public function arrayGet(array &$array, $identifier = '', $fallback = null) {
		if (empty($identifier)) return $array;

		// create reference
		$parts = explode('.', $identifier);
		$returner =& $array;

		foreach ($parts as $part) {
			if (isset($returner[$part])) {
				// if the array key is set expand the reference
				$returner =& $returner[$part];
			} else {
				// delete the reference
				unset($returner);
				break;
			}
		}

		if (isset($returner)) return $returner;
		else return $fallback;
	}
public function arrayGet(array &$array, $identifier = '', $fallback = null) {
		if (empty($identifier)) return $array;

		// create reference
		$parts = explode('.', $identifier);
		$returner =& $array;

		foreach ($parts as $part) {
			if (isset($returner[$part])) {
				// if the array key is set expand the reference
				$returner =& $returner[$part];
			} else {
				// delete the reference
				unset($returner);
				break;
			}
		}

		if (isset($returner)) return $returner;
		else return $fallback;
	}
public function arrayGet ( array & $ array , $ identifier = '' , $ fallback = null ) { if ( empty ( $ identifier ) ) return $ array ; // create reference $ parts = explode ( '.' , $ identifier ) ; $ returner = & $ array ; foreach ( $ parts as $ part ) { if ( isset ( $ returner [ $ part ] ) ) { // if the array key is set expand the reference $ returner = & $ returner [ $ part ] ; } else { // delete the reference unset ( $ returner ) ; break ; } } if ( isset ( $ returner ) ) return $ returner ; else return $ fallback ; }
Returns a branch or a value of a multidimensional array tree by use of the dot syntax to define subnodes.

Usage example:

~~~{.php}
class Dummy extends \Morrow\Core\Base {
public function foo() {
$data = [
0 => [
'title' => 'Foo',
'position' => 1,
],
1 => [
'title' => 'Bar',
'position' => 0,
],
];

return $this->arrayGet($data, '1.title');
}
}
~~~

@param  array $array The input array which should be searched.
@param  string $identifier A string of array keys separated by dots.
@param  mixed $fallback Will be returned if the `$identifier` could not be found.
@return array Returns the subnode.
Returns a branch or a value of a multidimensional array tree by use of the dot syntax to define subnodes .