public static function unflattenArray($array, $delimiter = '.') {
        if(!is_array($array)) {
            return $array;
        }

        $add = array();

        foreach($array as $key => $value) {
            if(strpos($key, $delimiter) === FALSE) {
                continue;
            }

            $add[] = [ explode($delimiter, $key), $value ];

            unset($array[$key]);
        }

        foreach($add as $pair) {
            $current = &$array;

            while(!is_null($key = array_shift($pair[0]))) {
                if(!is_array($current)) {
                    $current = array();
                }

                if(!array_key_exists($key, $current)) {
                    $current[$key] = array();
                }

                $current = &$current[$key];
            }

            $current = $pair[1];
        }

        return $array;
    }