PHP | stream_get_filters() Function

The stream_get_filters() function is an inbuilt function in PHP which is used to get the list of registered stream filters.

Syntax:

array stream_get_filters( void )

Parameters: This function does not accept any parameter.

Return Value: This function returns an array containing the name of all available stream filters.

Below programs illustrate the stream_get_filters() function in PHP:

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// PHP program to illustrate
// stream_get_filter function
  
$streamlist = stream_get_filters();
print_r($streamlist);
?>

chevron_right


Output:

Array
(
    [0] => zlib.*
    [1] => string.rot13
    [2] => string.toupper
    [3] => string.tolower
    [4] => string.strip_tags
    [5] => convert.*
    [6] => consumed
    [7] => dechunk
    [8] => convert.iconv.*
)

Program 2: Program to print number of filters return by function.

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// PHP program to illustrate
// stream_get_filter function
  
$res = stream_get_filters();
  
$count = sizeof($res);
  
// Print result
echo "Total Available Filters = " . $count;
?>

chevron_right


Output:

Total Available Filters = 9

Reference: http://php.net/manual/en/function.stream-get-filters.php



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.