diff --git a/reference/url/constants.xml b/reference/url/constants.xml new file mode 100644 index 0000000000..5e87ec6f29 --- /dev/null +++ b/reference/url/constants.xml @@ -0,0 +1,121 @@ + + +
+ &reftitle.constants; + &extension.constants; + + The following constants are meant to be used with + parse_url and are available since PHP 5.1.2. + + + + + PHP_URL_SCHEME + (integer) + + + + + + + + + + PHP_URL_HOST + (integer) + + + + + + + + + + PHP_URL_PORT + (integer) + + + + + + + + + + PHP_URL_USER + (integer) + + + + + + + + + + PHP_URL_PASS + (integer) + + + + + + + + + + PHP_URL_PATH + (integer) + + + + + + + + + + PHP_URL_QUERY + (integer) + + + + + + + + + + PHP_URL_FRAGMENT + (integer) + + + + + + + + +
+ + diff --git a/reference/url/functions/parse-url.xml b/reference/url/functions/parse-url.xml index fb6d069756..53c854624a 100644 --- a/reference/url/functions/parse-url.xml +++ b/reference/url/functions/parse-url.xml @@ -1,5 +1,5 @@ - + @@ -9,8 +9,9 @@ &reftitle.description; - arrayparse_url + mixedparse_url stringurl + intcomponent This function parses a URL and returns an associative array containing any @@ -37,6 +38,22 @@ + + + component + + + Specify one of PHP_URL_SCHEME, + PHP_URL_HOST, PHP_URL_PORT, + PHP_URL_USER, PHP_URL_PASS, + PHP_URL_PATH, PHP_URL_QUERY + or PHP_URL_FRAGMENT to retrieve just a specific + URL component as a string. + + + + + @@ -89,6 +106,32 @@ + + If the component parameter is specified a + string is returned instead of an array. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.1.2 + Added the component parameter + + + + + @@ -102,6 +145,8 @@ $url = 'http://username:password@hostname/path?arg=value#anchor'; print_r(parse_url($url)); + +echo parse_url($url, PHP_URL_PATH); ?> ]]> @@ -118,6 +163,7 @@ Array [query] => arg=value [fragment] => anchor ) +/path ]]> @@ -146,6 +192,7 @@ Array pathinfo parse_str + http_build_query dirname basename diff --git a/reference/url/reference.xml b/reference/url/reference.xml index a3764457b4..96d9836d6f 100644 --- a/reference/url/reference.xml +++ b/reference/url/reference.xml @@ -1,5 +1,5 @@ - + @@ -35,10 +35,7 @@ &no.resource; -
- &reftitle.constants; - &no.constants; -
+ &reference.url.constants;