URL 编码类

属性
命名空间 fize\crypt
类名 Url
方法:
方法名 说明
parse() 解析 URL,返回其组成部分
rawDecode() 对已编码的 URL 字符串进行解码
rawEncode() 按照 RFC 3986 对 URL 进行编码
decode() 解码已编码的 URL 字符串
encode() 编码 URL 字符串

方法

parse()

解析 URL,返回其组成部分

public static function parse (

    string $url,

    int $component = -1

) : array|string|int
参数:
名称 说明
url 要解析的 URL。无效字符将使用 _ 来替换。
component 指定返回的部分

rawDecode()

对已编码的 URL 字符串进行解码

public static function rawDecode (

    string $str

) : string
参数:
名称 说明
str 要解码的 URL 字符串

rawEncode()

按照 RFC 3986 对 URL 进行编码

public static function rawEncode (

    string $str

) : string
参数:
名称 说明
str 要编码的 URL

decode()

解码已编码的 URL 字符串

public static function decode (

    string $str

) : string
参数:
名称 说明
str 要解码的 URL 字符串

encode()

编码 URL 字符串

public static function encode (

    string $str

) : string
参数:
名称 说明
str 要编码的 URL