diff --git a/appendices/filters.xml b/appendices/filters.xml index 5377662352..9a71e19b02 100644 --- a/appendices/filters.xml +++ b/appendices/filters.xml @@ -1,5 +1,5 @@ - + List of Built-In Filters @@ -45,60 +45,97 @@ the corresponding function. - - - - String Filters - - - - - Name - PHP Function equivalent - Since Version - Parameters - - - - - string.rot13 - - str_rot13 - - PHP 4.3.0 - None - - - string.toupper - - strtoupper - - PHP 5.0.0 - None - - - string.tolower - - strtolower - - PHP 5.0.0 - None - - - string.strip_tags - - strip_tags - - PHP 5.0.0 - - String containing allowable tags, similar to second parameter of strip_tags. - May also be an array containing list of tags (excluding <> symbols). - - - - -
-
+ + string.rot13 + (since PHP 4.3.0) + Use of this filter is equivalent to processing all stream data through + the str_rot13 function. + + + string.rot13 + + +]]> + + + + + string.toupper + (since PHP 5.0.0) + Use of this filter is equivalent to processing all stream data through + the strtoupper function. + + + string.toupper + + +]]> + + + + + string.tolower + (since PHP 5.0.0) + Use of this filter is equivalent to processing all stream data through + the strtolower function. + + + string.tolower + + +]]> + + + + + string.strip_tags + (since PHP 5.0.0) + Use of this filter is equivalent to processing all stream data through + the strip_tags function. + It accepts parameters in one of two forms: + Either as a string containing a list of tags similar to the + second parameter of the strip_tags function, + or as an array of tag names. + + + string.strip_tags + +"); +fwrite($fp, "bolded text enlarged to a

level 1 heading

\n"); +fclose($fp); +/* Outputs: bolded text enlarged to a level 1 heading */ + +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, array('b','i','u')); +fwrite($fp, "bolded text enlarged to a

level 1 heading

\n"); +fclose($fp); +/* Outputs: bolded text enlarged to a level 1 heading */ +?> +]]> +
+
+
@@ -106,77 +143,84 @@ Like the string.* filters, the convert.* filters perform actions - similar to their names. + similar to their names. The convert filters were added with + PHP 5.0.0. For more information on a given filter, refer to the manual page for the corresponding function. - - - - Convert Filters - - - - - Name - PHP Function equivalent - Since Version - Parameters - - - - - convert.base64-encode - - base64_encode - - PHP 5.0.0 - - If parameters are provided as an associative array, - convert.base64-encode will insert the value of - $parameters['line-break-chars'] every $parameters['line-length'] - characters of base64 output. This allow automatic formatting of encoded output - otherwise achieved using chunk_split. - - - - convert.base64-decode - - base64_decode - - PHP 5.0.0 - None - - - convert.quoted-printable-encode - - None. This is the counterpart to quoted-printable-decode. - - PHP 5.0.0 - - line-break-chars and line-length are supported - in the same manner as convert.base64-encode above. In addition, - binary and force-encode-first are supported as - boolean values which default to &false;. - - - - convert.quoted-printable-decode - - quoted_printable_decode - - PHP 5.0.0 - - If line-break-chars were specified during the encoding process, - they should be specified here again in order to be stripped out for a successful decode. - - - - -
-
+ + convert.base64-encode and + convert.base64-decode + Use of these filters are equivalent to processing all stream data through + the base64_encode and base64_decode + functions respectively. + convert.base64-encode supports parameters given as + an associative array. If line-length is given, the + base64 output will be split into chunks of line-length + characters each. If line-braek-chars is given, each + chunk will be delimted by the characters given. These parameters give the + same effect as using base64_encode with + chunk_split. + + + convert.base64_encode + + 8, 'line-break-chars' => "\r\n"); +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'convert.base64-encode', STREAM_FILTER_WRITE, $param); +fwrite($fp, "This is a test.\n"); +fclose($fp); +/* Outputs: VGhpcyBp + : cyBhIHRl + : c3QuCg== */ + +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'convert.base64-decode'); +fwrite($fp, "VGhpcyBpcyBhIHRlc3QuCg=="); +fclose($fp); +/* Outputs: This is a test. */ +?> +]]> + + + + + convert.quoted-printable-encode and + convert.quoted-printable-decode + Use of the decode version of this filter is equivalent to processing all stream + data through the quoted_printable_decode functions. + There is no function equivalent to convert.quoted-printable-encode. + convert.quoted-printable-encode supports parameters given as + an associative array. In addition to the parameters supported by + convert.base64-encode, convert.quoted-printable-encode + also supports boolean arguments binary and + force-encode-first. + convert.base64-decode only supports the + line-break-chars parameter as a type-hint + for striping from the encoded payload. + + + string.tolower + + +]]> + +