public static function multibyteParseUrl($url)
    {
        $enc_url = preg_replace_callback(
            '%[^:/@?&=#]+%usD',
            function ($matches) {
                return urlencode($matches[0]);
            },
            $url
        );

        $parts = parse_url($enc_url);

        if($parts === false) {
            throw new \InvalidArgumentException('Malformed URL: ' . $url);
        }

        foreach($parts as $name => $value) {
            $parts[$name] = urldecode($value);
        }

        return $parts;
    }
public static function multibyteParseUrl($url)
    {
        $enc_url = preg_replace_callback(
            '%[^:/@?&=#]+%usD',
            function ($matches) {
                return urlencode($matches[0]);
            },
            $url
        );

        $parts = parse_url($enc_url);

        if($parts === false) {
            throw new \InvalidArgumentException('Malformed URL: ' . $url);
        }

        foreach($parts as $name => $value) {
            $parts[$name] = urldecode($value);
        }

        return $parts;
    }
public static function multibyteParseUrl ( $ url ) { $ enc_url = preg_replace_callback ( '%[^:/@?&=#]+%usD' , function ( $ matches ) { return urlencode ( $ matches [ 0 ] ) ; } , $ url ) ; $ parts = parse_url ( $ enc_url ) ; if ( $ parts === false ) { throw new \ InvalidArgumentException ( 'Malformed URL: ' . $ url ) ; } foreach ( $ parts as $ name => $ value ) { $ parts [ $ name ] = urldecode ( $ value ) ; } return $ parts ; }
Multibyte-safe Parse URL function

@param string $url
@return array
@throws \InvalidArgumentException
Multibyte - safe Parse URL function