PHP filter_list() Function

PHP Filter Reference : List all supported filter names

Definition and Usage

The filter_list() function returns a list of all the supported filter names.

Syntax

filter_list()

Technical Details

Return Value: An array of all supported filter names, an empty array if there are no filter names
PHP Version: 5.2+

More Examples

Example

Here, the filter_id() and the filter_list() functions are used to list the ID and filter name of all filters:

<table>
  <tr>
    <td>Filter Name</td>
    <td>Filter ID</td>
  </tr>
  <?php
  foreach (filter_list() as $id =>$filter) {
    echo '<tr><td>' . $filter . '</td><td>' . filter_id($filter) . '</td></tr>';
  }
?>
</table>

❮ PHP Filter Reference