public static function expand($array)
    {
        $multiArray = [];

        foreach ($array as $key=>&$value)
        {
            $keys = explode('.', $key);
            $lastKey = array_pop($keys);
            $currentPointer = &$multiArray;

            foreach ($keys as $currentKey)
            {
                if (!isset($currentPointer[$currentKey]))
                {
                    $currentPointer[$currentKey] = [];
                }

                $currentPointer = &$currentPointer[$currentKey];
            }

            $currentPointer[$lastKey] = $value;
        }

        return $multiArray;
    }
public static function expand($array)
    {
        $multiArray = [];

        foreach ($array as $key=>&$value)
        {
            $keys = explode('.', $key);
            $lastKey = array_pop($keys);
            $currentPointer = &$multiArray;

            foreach ($keys as $currentKey)
            {
                if (!isset($currentPointer[$currentKey]))
                {
                    $currentPointer[$currentKey] = [];
                }

                $currentPointer = &$currentPointer[$currentKey];
            }

            $currentPointer[$lastKey] = $value;
        }

        return $multiArray;
    }
public static function expand ( $ array ) { $ multiArray = [ ] ; foreach ( $ array as $ key => & $ value ) { $ keys = explode ( '.' , $ key ) ; $ lastKey = array_pop ( $ keys ) ; $ currentPointer = & $ multiArray ; foreach ( $ keys as $ currentKey ) { if ( ! isset ( $ currentPointer [ $ currentKey ] ) ) { $ currentPointer [ $ currentKey ] = [ ] ; } $ currentPointer = & $ currentPointer [ $ currentKey ] ; } $ currentPointer [ $ lastKey ] = $ value ; } return $ multiArray ; }
Expand flattened array into a multi-dimensional one.

@param $array
@return array
Expand flattened array into a multi - dimensional one .