filter_list & filter_idWe can display list of available filters by using filter_list function. This function returns an array with list of available filters as elements. Here is the example.
The output is here
Now we will modify it by displaying in a formatted output.We used standard array display techniques to display the elements of the arrayHere is the code to display output
The output is here ( Note that the serial number is the key number of the array filter_list not the filter ID number )
filter_idWE can get the filter id of the particular filter in PHP by using filter_id function. We will input the name of the filter and get the associated id of it. The list containing name of filter is available at filter_list page. Here is the syntax.
Here is one example
echo filter_id('validate_url');
The output of above line is here
We can also display the associated id of all the filters in a single list. Here is the sample code.
The output is here
PHP Filters
filter_list:PHP list of filters available and how to display
filter_has_var: checking the existance of variable in PHP
filter_var: Validating variable using filter id
FILTER_VALIDATE_FLOAT: Validating Float data
FILTER_VALIDATE_INT: Validating Integer with Maximum and Minimum range
FILTER_VALIDATE_REGEXP: Validating Regular Expression
FILTER_VALIDATE_EMAIL: Validating Email
FILTER_VALIDATE_URL: Validating URL with query string and path
FILTER_VALIDATE_IP: Validating IPV4 and IPV6 address
FILTER_VALIDATE_BOOLEAN: Validating boolean variable
FILTER_SANITIZE_STRING: Sanitize string
FILTER_SANITIZE_URL: Sanitize URL
This article is written by plus2net.com team.
![]() |
filter_list:PHP list of filters available and how to display
filter_has_var: checking the existance of variable in PHP filter_var: Validating variable using filter id FILTER_VALIDATE_FLOAT: Validating Float data FILTER_VALIDATE_INT: Validating Integer with Maximum and Minimum range FILTER_VALIDATE_REGEXP: Validating REgular Expression FILTER_VALIDATE_EMAIL: Validating Email FILTER_VALIDATE_URL: Validating URL with query string and path FILTER_VALIDATE_IP: Validating IPV4 and IPV6 address FILTER_VALIDATE_BOOLEAN: Validating boolean variable FILTER_SANITIZE_STRING: Sanitize string FILTER_SANITIZE_URL: Sanitize url |