Extraction functions
The URL extraction functions extract components from HTTP URLs (or any valid URIs conforming to RFC 2396). The following syntax is supported::
or ?
.
url_extract_fragment
url
.
url_extract_host
url
.
url_extract_parameter
name
from url
. Parameter extraction is handled in the typical manner
as specified by RFC 1866.
url_extract_path
url
.
url_extract_port
url
.
url_extract_protocol
url
:
url_extract_query
url
.
Encoding functions
url_encode
value
by encoding it so that it can be safely included in
URL query parameter names and values:
- Alphanumeric characters are not encoded.
- The characters
.
,-
,*
and_
are not encoded. - The ASCII space character is encoded as
+
. - All other characters are converted to UTF-8 and the bytes are encoded
as the string
%XX
whereXX
is the uppercase hexadecimal value of the UTF-8 byte.
url_decode
value
.
This function is the inverse of url_encode().