dismiss Step into the future! Click here to switch to the beta php.net site
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

filter_input_array> <filter_has_var
[edit] Last updated: Fri, 28 Jun 2013

view this page in

filter_id

(PHP 5 >= 5.2.0)

filter_idReturns the filter ID belonging to a named filter

Description

int filter_id ( string $filtername )

Parameters

filtername

Name of a filter to get.

Return Values

ID of a filter on success or FALSE if filter doesn't exist.

See Also



add a note add a note User Contributed Notes filter_id - [1 notes]
up
1
w0n4b3 at gmail dot com
2 years ago
[To get a list of filters and their IDs:]

<?php
$filters
= filter_list();
foreach(
$filters as $filter_name) {
    echo
$filter_name .": ".filter_id($filter_name) ."<br>";
}
?>
Will result in:
boolean: 258
float: 259
validate_regexp: 272
validate_url: 273
validate_email: 274
validate_ip: 275
string: 513
stripped: 513
encoded: 514
special_chars: 515
unsafe_raw: 516
email: 517
url: 518
number_int: 519
number_float: 520
magic_quotes: 521
callback: 1024

 
show source | credits | stats | sitemap | contact | advertising | mirror sites