From 50b2dea45f296af01ebba3ae34d4d40c795358c9 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sat, 12 Aug 2006 18:00:17 +0000 Subject: [PATCH] document the 2nd parameter of parse_url() and add its constants git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@218045 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/url/constants.xml | 121 ++++++++++++++++++++++++++ reference/url/functions/parse-url.xml | 51 ++++++++++- reference/url/reference.xml | 7 +- 3 files changed, 172 insertions(+), 7 deletions(-) create mode 100644 reference/url/constants.xml 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;