public static function makeNested(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            $keyParts = explode(':', $key);
            $current =& $result;
            foreach (static::tail($keyParts) as $keyPart) {
                if (!array_key_exists($keyPart, $current)) {
                    $current[$keyPart] = [];
                }
                $current =& $current[$keyPart];
            }
            $current[static::end($keyParts)] = $value;
        }
        return $result;
    }
public static function makeNested(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            $keyParts = explode(':', $key);
            $current =& $result;
            foreach (static::tail($keyParts) as $keyPart) {
                if (!array_key_exists($keyPart, $current)) {
                    $current[$keyPart] = [];
                }
                $current =& $current[$keyPart];
            }
            $current[static::end($keyParts)] = $value;
        }
        return $result;
    }
public static function makeNested ( array $ data ) : array { $ result = [ ] ; foreach ( $ data as $ key => $ value ) { $ keyParts = explode ( ':' , $ key ) ; $ current = & $ result ; foreach ( static :: tail ( $ keyParts ) as $ keyPart ) { if ( ! array_key_exists ( $ keyPart , $ current ) ) { $ current [ $ keyPart ] = [ ] ; } $ current = & $ current [ $ keyPart ] ; } $ current [ static :: end ( $ keyParts ) ] = $ value ; } return $ result ; }
Make a flat array nested.
@param array $data
@return array
Make a flat array nested .