Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,870 questions

51,793 answers

573 users

How to get the list of all supported filters in PHP

3 Answers

0 votes
/*
array filter_list ( void )
*/
  
echo "<pre>" . print_r(filter_list(), 1) . "</pre>";
      
/*
run:
  
Array
(
    [0] => int
    [1] => boolean
    [2] => float
    [3] => validate_regexp
    [4] => validate_url
    [5] => validate_email
    [6] => validate_ip
    [7] => string
    [8] => stripped
    [9] => encoded
    [10] => special_chars
    [11] => full_special_chars
    [12] => unsafe_raw
    [13] => email
    [14] => url
    [15] => number_int
    [16] => number_float
    [17] => magic_quotes
    [18] => callback
)

*/

 



answered Dec 24, 2015 by avibootz
0 votes
/*
array filter_list ( void )
int filter_id ( string $filtername )
*/
  
foreach (filter_list() as $key => $value)
    echo "<br>".$key."=".$value.'='.filter_id($value);
      
/*
run:
  
0=int=257
1=boolean=258
2=float=259
3=validate_regexp=272
4=validate_url=273
5=validate_email=274
6=validate_ip=275
7=string=513
8=stripped=513
9=encoded=514
10=special_chars=515
11=full_special_chars=522
12=unsafe_raw=516
13=email=517
14=url=518
15=number_int=519
16=number_float=520
17=magic_quotes=521
18=callback=1024 

*/

 



answered Dec 24, 2015 by avibootz
0 votes
/*
array filter_list ( void )
int filter_id ( string $filtername )
*/
  
$filters = filter_list();
foreach($filters as $filter_name)
    echo $filter_name .": ".filter_id($filter_name) ."<br>";

      
/*
run:
  
int: 257
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
full_special_chars: 522
unsafe_raw: 516
email: 517
url: 518
number_int: 519
number_float: 520
magic_quotes: 521
callback: 1024

*/

 



answered Dec 24, 2015 by avibootz

Related questions

1 answer 195 views
1 answer 295 views
1 answer 203 views
1 answer 204 views
1 answer 204 views
1 answer 155 views
...