static function parse_str($query)
    {
        if ($query === null) {
            return null;
        }

        $parts = explode('&', $query);

        $new_parts = array();
        for ($i = 0; $i < count($parts); $i++) {
            $pair = explode('=', $parts[$i]);

            if (count($pair) != 2) {
                continue;
            }

            list($key, $value) = $pair;
            $new_parts[urldecode($key)] = urldecode($value);
        }

        return $new_parts;
    }
static function parse_str($query)
    {
        if ($query === null) {
            return null;
        }

        $parts = explode('&', $query);

        $new_parts = array();
        for ($i = 0; $i < count($parts); $i++) {
            $pair = explode('=', $parts[$i]);

            if (count($pair) != 2) {
                continue;
            }

            list($key, $value) = $pair;
            $new_parts[urldecode($key)] = urldecode($value);
        }

        return $new_parts;
    }
static function parse_str ( $ query ) { if ( $ query === null ) { return null ; } $ parts = explode ( '&' , $ query ) ; $ new_parts = array ( ) ; for ( $ i = 0 ; $ i < count ( $ parts ) ; $ i ++ ) { $ pair = explode ( '=' , $ parts [ $ i ] ) ; if ( count ( $ pair ) != 2 ) { continue ; } list ( $ key , $ value ) = $ pair ; $ new_parts [ urldecode ( $ key ) ] = urldecode ( $ value ) ; } return $ new_parts ; }
Replacement for PHP's broken parse_str.

@param string|null $query
@return array|null
Replacement for PHP s broken parse_str .