Syntax:array filter_list (void)
Parameters:this function is not takes no parameters.
Returned Values:Returns an array containing all the supported filter names. If it returns an empty array, then it does not contain any filters. The filter ID can be obtained using the filter_id() function.
Note.This function is available for PHP 5.2.0 and newer.Below are examples illustrating the filter_id() function in PHP:
Example 1:
print_r (filter_list());
?>
Exit:Array ([ 0] = > int [1] = > boolean [2] = > float [3] = > validate_regexp [4] = > validate_domain [5] = > validate_url [6] = > validate_email [7 ] = > validate_ip [8] = > validate_mac [9] = > string [10] = > stripped [11] = > encoded [12] = > special_chars [13] = > full_special_chars [14] = > unsafe_raw [15] = > email [16] = > url [17] = > number_int [18] = > number_float [19] = > magic_quotes [20] = > callback) Example 2:displays the associated ID of all filters in one list.
// Array filter function assigned to variable
$arr
= filter_list();
// Using a loop to display the key and its value
while
(list (
$key
,
$val
) = each (
$ar2
)) {
echo
" $key -> $val: ("
. filter_id (
$val
).
")
"
;
}
?>
Exit:0 -> int: (257)
1 -> boolean: (258)
2 -> float: (259)
3 -> validate_regexp: (272)
4 -> validate_domain: (277)
5 -> validate_url: (273)
6 -> validate_email: (274)
7 -> validate_ip: (275)
8 -> validate_mac: (276)
9 -> string: (513)
10 -> stripped: (513)
11 -> encoded: (514)
12 -> special_chars: (515)
13 -> full_special_chars: (522)
14 -> unsafe_raw: (516)
15 -> email: (517)
16 -> url: (518)
17 -> number_int: (519)
18 -> number_float: (520)
19 -> magic_quotes: (521)
20 -> callback: (1024)
Links: http://php.net/manual/en/function.filter-list.php