Function name: stream_get_filters()
Applicable version: PHP 4 >= 4.3.0, PHP 5, PHP 7
Function Description: The stream_get_filters() function is used to return a registered list of stream filters.
Syntax: array stream_get_filters(void)
Parameters: This function has no parameters.
Return value: Returns an array containing the registered stream filter names. If there is no registered filter, an empty array is returned.
Example:
$filters = stream_get_filters(); print_r($filters);
Output:
Array ( [0] => zlib.inflate [1] => zlib.deflate [2] => string.rot13 [3] => string.toupper [4] => string.tolower [5] => string.strip_tags [6] => convert.iconv.* [7] => consumed [8] => dechunk [9] => bzip2.compress [10] => bzip2.decompress [11] => zlib.compress [12] => zlib.uncompress [13] => mcrypt.* [14] => mdecrypt.* )
The above example shows how to use the stream_get_filters() function to get a registered stream filter list and print it out. In this example, we get a series of registered filter names such as zlib.inflate, zlib.deflate, string.rot13, etc. These filters can be used in stream processing functions to implement different data filtering and conversion operations.