Urlencode (PHP4, PHP5) urlencode & nbsp; & mdash; & nbsp; URL string description string & nbsp; urlencode & nbsp; (& nbsp; string & nbsp; $ str & nbsp;) This function allows you to encode a string and use it in the request section of the URL.
(PHP 4, PHP 5)
Urlencode? -? Encode a URL string
Description string?
Urlencode? (? String?
$str
?)
This function allows you to encode a string and use it in the URL request section. It also allows you to pass variables to the next page.
Parameters
-
str
-
The string to be encoded.
Return value
Returns a string, except?-_.? All other non-alphanumeric characters will be replaced with a semicolon (%) Followed by two hexadecimal numbers, and space is encoded as the plus sign (+). This encoding method is the same as that for WWW form POST data?Application/x-www-form-urlencoded? The media type encoding method is the same. For historical reasons, this encoding is used to encode spaces as the plus sign (+) and RFC1738 encoding (see? Rawurlencode () is different.
Example
Example #1?Urlencode ()? Example
Example #2?Urlencode ()? And? Htmlentities ()? Example
Other functions
- Urldecode ()? -Decode the encoded URL string.
- Htmlentities ()? -Convert all adaption characters to HTML Character encoding
- Rawurlencode ()? -Encode the URL according to RFC 1738
- Rawurldecode ()? -Decode the encoded URL string
- ?? RFC 3986