protected function _normalizeData($args, $path = '')
    {
        $data = [];
        foreach ($args as $key => $value) {
            if ($path) {
                // Fold string keys with [].
                // Numeric keys result in a=b&a=c. While this isn't
                // standard behavior in PHP, it is common in other platforms.
                if (!is_numeric($key)) {
                    $key = "{$path}[{$key}]";
                } else {
                    $key = $path;
                }
            }
            if (is_array($value)) {
                uksort($value, 'strcmp');
                $data = array_merge($data, $this->_normalizeData($value, $key));
            } else {
                $data[] = [$key, $value];
            }
        }

        return $data;
    }
protected function _normalizeData($args, $path = '')
    {
        $data = [];
        foreach ($args as $key => $value) {
            if ($path) {
                // Fold string keys with [].
                // Numeric keys result in a=b&a=c. While this isn't
                // standard behavior in PHP, it is common in other platforms.
                if (!is_numeric($key)) {
                    $key = "{$path}[{$key}]";
                } else {
                    $key = $path;
                }
            }
            if (is_array($value)) {
                uksort($value, 'strcmp');
                $data = array_merge($data, $this->_normalizeData($value, $key));
            } else {
                $data[] = [$key, $value];
            }
        }

        return $data;
    }
protected function _normalizeData ( $ args , $ path = '' ) { $ data = [ ] ; foreach ( $ args as $ key => $ value ) { if ( $ path ) { // Fold string keys with []. // Numeric keys result in a=b&a=c. While this isn't // standard behavior in PHP, it is common in other platforms. if ( ! is_numeric ( $ key ) ) { $ key = "{$path}[{$key}]" ; } else { $ key = $ path ; } } if ( is_array ( $ value ) ) { uksort ( $ value , 'strcmp' ) ; $ data = array_merge ( $ data , $ this -> _normalizeData ( $ value , $ key ) ) ; } else { $ data [ ] = [ $ key , $ value ] ; } } return $ data ; }
Recursively convert request data into the normalized form.

@param array $args The arguments to normalize.
@param string $path The current path being converted.
@see https://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
@return array
Recursively convert request data into the normalized form .