src/Core/Base.php
public function arrayExplode(array $array) {
		$data = [];

		// iterate keys
		foreach ($array as $rkey => $row) {
			$parent =& $data;
			$parts = explode('.', $rkey);

			// iterate key parts
			foreach ($parts as $part) {
				// build values
				if (!isset($parent[$part]) || !is_array($parent[$part])) {
					if ($part === end($parts)) {
						if (!is_array($row)) $parent[$part] = $row;
						else $parent[$part] = $this->arrayExplode($row);
					}
					else $parent[$part] = [];
				}
				$parent = &$parent[$part];
			}
		}
		return $data;
	}
public function arrayExplode(array $array) {
		$data = [];

		// iterate keys
		foreach ($array as $rkey => $row) {
			$parent =& $data;
			$parts = explode('.', $rkey);

			// iterate key parts
			foreach ($parts as $part) {
				// build values
				if (!isset($parent[$part]) || !is_array($parent[$part])) {
					if ($part === end($parts)) {
						if (!is_array($row)) $parent[$part] = $row;
						else $parent[$part] = $this->arrayExplode($row);
					}
					else $parent[$part] = [];
				}
				$parent = &$parent[$part];
			}
		}
		return $data;
	}
public function arrayExplode ( array $ array ) { $ data = [ ] ; // iterate keys foreach ( $ array as $ rkey => $ row ) { $ parent = & $ data ; $ parts = explode ( '.' , $ rkey ) ; // iterate key parts foreach ( $ parts as $ part ) { // build values if ( ! isset ( $ parent [ $ part ] ) || ! is_array ( $ parent [ $ part ] ) ) { if ( $ part === end ( $ parts ) ) { if ( ! is_array ( $ row ) ) $ parent [ $ part ] = $ row ; else $ parent [ $ part ] = $ this -> arrayExplode ( $ row ) ; } else $ parent [ $ part ] = [ ] ; } $ parent = & $ parent [ $ part ] ; } } return $ data ; }
Explodes an array with dotted keys to a normal array.

Usage example:

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

return $this->arrayExplode($data);
}
}
~~~

@param  array $array The input array that should be exploded.
@return null
Explodes an array with dotted keys to a normal array .