urlencode、urldecode、rawurlencode、rawurldecod

urlencode - URL encoded string

Description: urlencode (string $ str): string
This function is convenient for encoding a string of the URL request, as a convenient way to pass variables to the next page.

Returns a string, this string -_ than addition. All non-alphanumeric characters will be replaced with a percent (%) followed by two hex digits and spaces encoded as plus (+). This coding method encodes WWW POST form data is the same, at the same time as the media type and encoding application / x-www-form-urlencoded of.

urldecode - URL decoding the encoded string

Description: urldecode (string $ str): string
decoding any given encoded string ##%. The plus sign ( '+') is decoded into a space character.

Returns a string decoded.

Example:

 

 

 rawurlencode:

Returns a string, this string except -_. All non-alphanumeric characters will be replaced with a percent (%) followed by two hexadecimal digits. This is messed up encoding described in »RFC 3986 in order to protect its literal characters so as not to be interpreted as special URL delimiters, while protecting protect it from being transmitted URL format media (like some email systems) use character conversion . (The difference between urlencode the fact that processing of the spaces)

 rawurldecod:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/jongty/p/12186657.html