From 521b2622386211934c0e05323d6aace6d3b28fa4 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Fri, 10 Mar 2006 04:54:53 +0000 Subject: [PATCH] WS, preparation for the new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@209052 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/url/functions/base64-decode.xml | 72 ++++---- reference/url/functions/base64-encode.xml | 92 +++++----- reference/url/functions/get-headers.xml | 89 +++++----- reference/url/functions/get-meta-tags.xml | 129 +++++++------- reference/url/functions/http-build-query.xml | 171 +++++++++---------- reference/url/functions/rawurldecode.xml | 76 ++++----- reference/url/functions/rawurlencode.xml | 96 +++++------ reference/url/functions/urldecode.xml | 58 +++---- reference/url/functions/urlencode.xml | 126 +++++++------- 9 files changed, 452 insertions(+), 457 deletions(-) diff --git a/reference/url/functions/base64-decode.xml b/reference/url/functions/base64-decode.xml index ad7725690f..a01270ee9a 100644 --- a/reference/url/functions/base64-decode.xml +++ b/reference/url/functions/base64-decode.xml @@ -1,49 +1,49 @@ - - - - - base64_decode - Decodes data encoded with MIME base64 - - - Description - - stringbase64_decode - stringencoded_data - - - base64_decode decodes - encoded_data and returns the original - data or &false; on failure. The returned data may be binary. - - - - <function>base64_decode</function> example - + + + + base64_decode + Decodes data encoded with MIME base64 + + + + Description + + stringbase64_decode + stringencoded_data + + + base64_decode decodes + encoded_data and returns the original + data or &false; on failure. The returned data may be binary. + + + + <function>base64_decode</function> example + ]]> - - - This example will produce: - - + + + This example will produce: + + - - - - - See also base64_encode and - RFC 2045 section 6.8. - - - + + + + + See also base64_encode and + RFC 2045 section 6.8. + + + - - - - base64_encode - Encodes data with MIME base64 - - - Description - - stringbase64_encode - stringdata - - - base64_encode returns - data encoded with base64. This encoding - is designed to make binary data survive transport through - transport layers that are not 8-bit clean, such as mail bodies. - - - Base64-encoded data takes about 33% more space than the original - data. - - - - <function>base64_encode</function> example - + + + + base64_encode + Encodes data with MIME base64 + + + + Description + + stringbase64_encode + stringdata + + + base64_encode returns + data encoded with base64. This encoding + is designed to make binary data survive transport through + transport layers that are not 8-bit clean, such as mail bodies. + + + Base64-encoded data takes about 33% more space than the original + data. + + + + <function>base64_encode</function> example + ]]> - - - This example will produce: - - + + + This example will produce: + + - - - - - See also - base64_decode, - chunk_split, - convert_uuencode and - RFC 2045 section 6.8. - - - + + + + + See also + base64_decode, + chunk_split, + convert_uuencode and + RFC 2045 section 6.8. + + + - - - get_headers - - Fetches all the headers sent by the server in response to a HTTP request - - - - Description - - arrayget_headers - stringurl - intformat - - - get_headers returns an array with the headers sent - by the server in response to a HTTP request. Returns &false; on failure - and an error of level E_WARNING will be issued. - - - If the optional format parameter is set to 1, - get_headers parses the response and sets the array's - keys. - - - - Since PHP 5.1.3 this function uses the default stream context, which can - be set/changed with the stream_context_get_default - function. - - - - - <function>get_headers</function> example - + + + + + get_headers + Fetches all the headers sent by the server in response to a HTTP request + + + + Description + + arrayget_headers + stringurl + intformat + + + get_headers returns an array with the headers sent + by the server in response to a HTTP request. Returns &false; on failure + and an error of level E_WARNING will be issued. + + + If the optional format parameter is set to 1, + get_headers parses the response and sets the array's + keys. + + + + Since PHP 5.1.3 this function uses the default stream context, which can + be set/changed with the stream_context_get_default + function. + + + + + <function>get_headers</function> example + ]]> - - &example.outputs.similar; - + + &example.outputs.similar; + text/html ) ]]> - - - - - + + + + + - - - - get_meta_tags - - Extracts all meta tag content attributes from a file and returns - an array - - - - Description - - arrayget_meta_tags - stringfilename - booluse_include_path - - - Opens filename and parses it line by line - for <meta> tags in the file. This can be a local file or - an URL. The parsing stops at - </head>. - - - Setting use_include_path to &true; will result - in PHP trying to open the file along the standard include path - as per the include_path - directive. This is used for local files, not URLs. - - - - What <function>get_meta_tags</function> parses - + + + + get_meta_tags + Extracts all meta tag content attributes from a file and returns an array + + + + Description + + arrayget_meta_tags + stringfilename + booluse_include_path + + + Opens filename and parses it line by line + for <meta> tags in the file. This can be a local file or + an URL. The parsing stops at + </head>. + + + Setting use_include_path to &true; will result + in PHP trying to open the file along the standard include path + as per the include_path + directive. This is used for local files, not URLs. + + + + What <function>get_meta_tags</function> parses + @@ -39,24 +36,24 @@ ]]> - - - (pay attention to line endings - PHP uses a native function to - parse the input, so a Mac file won't work on Unix). - - - The value of the name property becomes the key, the value of the - content property becomes the value of the returned array, so you - can easily use standard array functions to traverse it or access - single values. Special characters in the value of the name - property are substituted with '_', the rest is converted to lower - case. If two meta tags have the same name, only the last one - is returned. - - - - What <function>get_meta_tags</function> returns - + + + (pay attention to line endings - PHP uses a native function to + parse the input, so a Mac file won't work on Unix). + + + The value of the name property becomes the key, the value of the + content property becomes the value of the returned array, so you + can easily use standard array functions to traverse it or access + single values. Special characters in the value of the name + property are substituted with '_', the rest is converted to lower + case. If two meta tags have the same name, only the last one + is returned. + + + + What <function>get_meta_tags</function> returns + ]]> - - - - - - As of PHP 4.0.5, get_meta_tags supports - unquoted HTML attributes. - - - - See also htmlentities and - urlencode. - - - + + + + + + As of PHP 4.0.5, get_meta_tags supports + unquoted HTML attributes. + + + + See also htmlentities and + urlencode. + + + - - - http_build_query - Generate URL-encoded query string - - - Description - - stringhttp_build_query - arrayformdata - stringnumeric_prefix - - - - Generates a URL-encoded query string from the associative (or indexed) array provided. - formdata may be an array or object containing properties. - A formdata array may be a simple one-dimensional structure, - or an array of arrays (who in turn may contain other arrays). If numeric indices - are used in the base array and a numeric_prefix is provided, - it will be prepended to the numeric index for elements in the base array only. - This is to allow for legal variable names when the data is decoded by PHP - or another CGI application later on. - - - - - arg_separator.output is - used to separate arguments. - - - - - Simple usage of <function>http_build_query</function> - + + + + http_build_query + Generate URL-encoded query string + + + + Description + + stringhttp_build_query + arrayformdata + stringnumeric_prefix + + + Generates a URL-encoded query string from the associative (or indexed) array provided. + formdata may be an array or object containing properties. + A formdata array may be a simple one-dimensional structure, + or an array of arrays (who in turn may contain other arrays). If numeric indices + are used in the base array and a numeric_prefix is provided, + it will be prepended to the numeric index for elements in the base array only. + This is to allow for legal variable names when the data is decoded by PHP + or another CGI application later on. + + + + + arg_separator.output is + used to separate arguments. + + + + + Simple usage of <function>http_build_query</function> + 'bar', 'baz'=>'boom', 'cow'=>'milk', 'php'=>'hypertext processor'); - + echo http_build_query($data); // foo=bar&baz=boom&cow=milk&php=hypertext+processor ?> ]]> - - + + - - <function>http_build_query</function> with numerically index elements. - + + <function>http_build_query</function> with numerically index elements. + 'milk', 'php' =>'hypertext processor'); - + echo http_build_query($data); /* Outputs: 0=foo&1=bar&2=baz&3=boom&cow=milk&php=hypertext+processor */ - + echo http_build_query($data, 'myvar_'); /* Outputs: myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk&php=hypertext+processor */ ?> ]]> - - + + - - <function>http_build_query</function> with complex arrays - + + <function>http_build_query</function> with complex arrays + array('name'=>'Bob Smith', @@ -83,47 +83,46 @@ $data = array('user'=>array('name'=>'Bob Smith', 'sally'=>array('age'=>8, 'sex'=>'F')), 'CEO'); - + echo http_build_query($data, 'flags_'); ?> ]]> - - - this will output : (word wrapped for readability) - - + + + this will output : (word wrapped for readability) + + - + + + - - - Only the numerically indexed element in the base array "CEO" received a - prefix. The other numeric indices, found under pastimes, do not - require a string prefix to be legal variable names. - - + Only the numerically indexed element in the base array "CEO" received a + prefix. The other numeric indices, found under pastimes, do not + require a string prefix to be legal variable names. - - - - Using <function>http_build_query</function> with an object - + + + + + + Using <function>http_build_query</function> with an object + foo = 'bar'; - $this->baz = 'boom'; - } + var $foo; + var $baz; + + function myClass() { + $this->foo = 'bar'; + $this->baz = 'boom'; + } } $data = new myClass(); @@ -132,18 +131,18 @@ echo http_build_query($data); // foo=bar&baz=boom ?> ]]> - - + + - - See also: - parse_str, - parse_url, - urlencode, and - array_walk - - - + + See also: + parse_str, + parse_url, + urlencode, and + array_walk + + + - - - - rawurldecode - Decode URL-encoded strings - - - Description - - stringrawurldecode - stringstr - - - Returns a string in which the sequences with percent - (%) signs followed by two hex digits have been - replaced with literal characters. - - - - <function>rawurldecode</function> example - + + + + rawurldecode + Decode URL-encoded strings + + + + Description + + stringrawurldecode + stringstr + + + Returns a string in which the sequences with percent + (%) signs followed by two hex digits have been + replaced with literal characters. + + + + <function>rawurldecode</function> example + ]]> - - - - - - rawurldecode does not decode plus symbols ('+') - into spaces. urldecode does. - - - - See also rawurlencode, - urldecode and - urlencode. - - - + + + + + + rawurldecode does not decode plus symbols ('+') + into spaces. urldecode does. + + + + See also rawurlencode, + urldecode and + urlencode. + + + - - - - rawurlencode - URL-encode according to RFC 1738 - - - Description - - stringrawurlencode - stringstr - - - Returns a string in which all non-alphanumeric characters except - -_. have been replaced with a percent - (%) sign followed by two hex digits. This is - the encoding described in RFC 1738 for protecting literal - characters from being interpreted as special URL delimiters, and - for protecting URLs from being mangled by transmission media - with character conversions (like some email systems). For - example, if you want to include a password in an FTP URL: - - - - <function>rawurlencode</function> example 1 - + + + + rawurlencode + URL-encode according to RFC 1738 + + + + Description + + stringrawurlencode + stringstr + + + Returns a string in which all non-alphanumeric characters except + -_. have been replaced with a percent + (%) sign followed by two hex digits. This is + the encoding described in RFC 1738 for protecting literal + characters from being interpreted as special URL delimiters, and + for protecting URLs from being mangled by transmission media + with character conversions (like some email systems). For + example, if you want to include a password in an FTP URL: + + + + <function>rawurlencode</function> example 1 + '; ?> ]]> - - - - - Or, if you pass information in a PATH_INFO component of the URL: - - - - <function>rawurlencode</function> example 2 - + + + + + Or, if you pass information in a PATH_INFO component of the URL: + + + + <function>rawurlencode</function> example 2 + '; ?> ]]> - - - - - See also rawurldecode, - urldecode, - urlencode and - RFC 1738. - - - + + + + + See also rawurldecode, + urldecode, + urlencode and + RFC 1738. + + + - - - - urldecode - Decodes URL-encoded string - - - Description - - stringurldecode - stringstr - - - Decodes any %## - encoding in the given string. The decoded string is returned. - - <function>urldecode</function> example - + + + + urldecode + Decodes URL-encoded string + + + + Description + + stringurldecode + stringstr + + + Decodes any %## + encoding in the given string. The decoded string is returned. + + <function>urldecode</function> example + ]]> - - - - - See also urlencode, - rawurlencode and - rawurldecode. - - - + + + + + See also urlencode, + rawurlencode and + rawurldecode. + + + - - - - urlencode - URL-encodes string - - - Description - - stringurlencode - stringstr - - - Returns a string in which all non-alphanumeric characters except - -_. have been replaced with a percent - (%) sign followed by two hex digits and spaces - encoded as plus (+) signs. It is encoded the - same way that the posted data from a WWW form is encoded, that is - the same way as in - application/x-www-form-urlencoded media type. - This differs from the RFC1738 encoding (see - rawurlencode) in that for historical - reasons, spaces are encoded as plus (+) signs. This function is - convenient when encoding a string to be used in a query part of - a URL, as a convenient way to pass variables to the next page: - - <function>urlencode</function> example - + + + + urlencode + URL-encodes string + + + + Description + + stringurlencode + stringstr + + + Returns a string in which all non-alphanumeric characters except + -_. have been replaced with a percent + (%) sign followed by two hex digits and spaces + encoded as plus (+) signs. It is encoded the + same way that the posted data from a WWW form is encoded, that is + the same way as in + application/x-www-form-urlencoded media type. + This differs from the RFC1738 encoding (see + rawurlencode) in that for historical + reasons, spaces are encoded as plus (+) signs. This function is + convenient when encoding a string to be used in a query part of + a URL, as a convenient way to pass variables to the next page: + + <function>urlencode</function> example + '; ?> ]]> - - - - - Note: Be careful about variables that may match HTML entities. - Things like &amp, &copy and &pound are parsed by the - browser and the actual entity is used instead of the desired - variable name. This is an obvious hassle that the W3C has been - telling people about for years. The reference is here: - &url.argsep;. PHP supports - changing the argument separator to the W3C-suggested semi-colon - through the arg_separator .ini directive. Unfortunately most user - agents do not send form data in this semi-colon separated format. - A more portable way around this is to use &amp; instead of - & as the separator. You don't need to change PHP's - arg_separator for this. Leave it as &, but simply encode - your URLs using htmlentities or - htmlspecialchars. - - - - <function>urlencode</function> and <function>htmlentities</function> example - + + + + + Note: Be careful about variables that may match HTML entities. + Things like &amp, &copy and &pound are parsed by the + browser and the actual entity is used instead of the desired + variable name. This is an obvious hassle that the W3C has been + telling people about for years. The reference is here: + &url.argsep;. PHP supports + changing the argument separator to the W3C-suggested semi-colon + through the arg_separator .ini directive. Unfortunately most user + agents do not send form data in this semi-colon separated format. + A more portable way around this is to use &amp; instead of + & as the separator. You don't need to change PHP's + arg_separator for this. Leave it as &, but simply encode + your URLs using htmlentities or + htmlspecialchars. + + + + <function>urlencode</function> and <function>htmlentities</function> example + '; ?> ]]> - - - - - See also urldecode, - htmlentities, - rawurldecode and - rawurlencode. - - - + + + + + See also urldecode, + htmlentities, + rawurldecode and + rawurlencode. + + +