src/Core/Base.php
public function arrayDelete(array &$array, $identifier) {
		// create reference
		$parts = explode('.', $identifier);
		$returner =& $array;
		$parent =& $array;

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

		if (isset($returner)) {
			unset($parent[$rkey]);
		} else {
			throw new \Exception(__CLASS__.': identifier "'.$identifier.'" does not exist.');
		}
	}
public function arrayDelete(array &$array, $identifier) {
		// create reference
		$parts = explode('.', $identifier);
		$returner =& $array;
		$parent =& $array;

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

		if (isset($returner)) {
			unset($parent[$rkey]);
		} else {
			throw new \Exception(__CLASS__.': identifier "'.$identifier.'" does not exist.');
		}
	}
public function arrayDelete ( array & $ array , $ identifier ) { // create reference $ parts = explode ( '.' , $ identifier ) ; $ returner = & $ array ; $ parent = & $ array ; foreach ( $ parts as $ part ) { // if the array key is set expand the reference if ( isset ( $ returner [ $ part ] ) && ! empty ( $ part ) ) { $ parent = & $ returner ; $ rkey = $ part ; $ returner = & $ returner [ $ part ] ; } else { // delete the reference unset ( $ returner ) ; break ; } } if ( isset ( $ returner ) ) { unset ( $ parent [ $ rkey ] ) ; } else { throw new \ Exception ( __CLASS__ . ': identifier "' . $ identifier . '" does not exist.' ) ; } }
Deletes a branch or a key 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->arrayDelete($data, '0.title');
}
}
~~~

@param  array $array The input array which should be extended.
@param  string $identifier A string of array keys separated by dots.
@return null
Deletes a branch or a key of a multidimensional array tree by use of the dot syntax to define subnodes .