HomeLanguagesPHP | stream_get_filters() Function

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:




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


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.




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


Output:

Total Available Filters = 9

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

6 COMMENTS

Most Popular

Dominic
32688 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7057 POSTS0 COMMENTS
Nicole Veronica
12198 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12293 POSTS0 COMMENTS
Shaida Kate Naidoo
7182 POSTS0 COMMENTS
Ted Musemwa
7447 POSTS0 COMMENTS
Thapelo Manthata
7160 POSTS0 COMMENTS
Umr Jansen
7150 POSTS0 COMMENTS