©
本文档使用 PHP中文网手册 发布
(PHP 5 >= 5.2.0, PHP 7)
filter_id — 返回与某个特定名称的过滤器相关联的id
$filtername
)
filtername
待获取的过滤器名称
如果获取成功则返回过滤器id,如果过滤器不存在则返回 FALSE
。
[#1] w0n4b3 at gmail dot com [2011-06-23 02:47:44]
[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