protected function expandDottedKey($data)
    {
        foreach ($data as $key => $value) {
            if (($found = strpos($key, '.')) !== false) {
                $newKey = substr($key, 0, $found);
                $remainder = substr($key, $found + 1);

                $expandedValue = $this->expandDottedKey(array($remainder => $value));
                if (isset($data[$newKey])) {
                    $data[$newKey] = array_merge_recursive($data[$newKey], $expandedValue);
                } else {
                    $data[$newKey] = $expandedValue;
                }
                unset($data[$key]);
            }
        }
        return $data;
    }
protected function expandDottedKey($data)
    {
        foreach ($data as $key => $value) {
            if (($found = strpos($key, '.')) !== false) {
                $newKey = substr($key, 0, $found);
                $remainder = substr($key, $found + 1);

                $expandedValue = $this->expandDottedKey(array($remainder => $value));
                if (isset($data[$newKey])) {
                    $data[$newKey] = array_merge_recursive($data[$newKey], $expandedValue);
                } else {
                    $data[$newKey] = $expandedValue;
                }
                unset($data[$key]);
            }
        }
        return $data;
    }
protected function expandDottedKey ( $ data ) { foreach ( $ data as $ key => $ value ) { if ( ( $ found = strpos ( $ key , '.' ) ) !== false ) { $ newKey = substr ( $ key , 0 , $ found ) ; $ remainder = substr ( $ key , $ found + 1 ) ; $ expandedValue = $ this -> expandDottedKey ( array ( $ remainder => $ value ) ) ; if ( isset ( $ data [ $ newKey ] ) ) { $ data [ $ newKey ] = array_merge_recursive ( $ data [ $ newKey ] , $ expandedValue ) ; } else { $ data [ $ newKey ] = $ expandedValue ; } unset ( $ data [ $ key ] ) ; } } return $ data ; }
Expand array with dotted keys to multidimensional array

@param array $data

@return array
Expand array with dotted keys to multidimensional array