PHP filter_id()Functions


PHP Filter 参考手册Complete PHP Filter Reference Manual

Definition and Usage

The filter_id() function returns the ID number of the specified filter.

Returns the filter ID number if successful, or NULL if the filter does not exist.

Syntax

filter_id(filter_name)

Parameter Description
filter_name Required. Specifies the filter whose ID number is to be retrieved.

Must be the filter name (not the filter ID name). Use the filter_list()function to get the names of all supported filters.


Examples

<?php
echo(filter_id("validate_email"));
?>

The output of the code is as follows:

274


PHP Filter 参考手册Complete PHP Filter Reference Manual Other Extensions