Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

filter_list()

Example

List all filter names supported by the filter_list() function.

<?php
print_r(filter_list());
?>

Definition and Usage

The filter_list() function returns an array of all the supported filter names.

Syntax

filter_list()

Technical Details

 

Return Value:

An array containing all supported filter names, or an empty array if no filter names are available.

PHP Version:

5.2+

More Examples

Example

In this case, the filter_id() and filter_list() functions are utilized to display the ID and name of all available 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>