Retrieve the filter ID for the VALIDATE_EMAIL filter.
| <?php echo(filter_id(“validate_email”)); ?> |
The filter_id() function returns the filter ID for a specified filter name.
| filter_id(filter_name) |
|
Parameter |
Description |
|
filter_name |
Required. The filter name for which to retrieve the ID. Tip: Use |
|
Return Value: |
Returns the filter ID on success, or FALSE if the filter does not exist. |
|
PHP Version: |
5.2+ |
In this context, the filter_id() and filter_list() functions are used to list the IDs and names 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> |