[PHP-NOTES] note 130173 added to function.filter-var

[email protected] ("[email protected]")
Newsgroups php.notes
Message-ID <[email protected]>
If you need the complete filters list you can get it ; here are 3 ways ..from beginner to advanced in php scripting (the tests were on an old PHP Version 8.2.12) :

for beginners: {
	-put this on a folder , in a file index.php 
	-if you are using a local server what it's ON put in browser http://localhost/name of the folder you created/  <--modify that and hit the <Enter> key
}

START:

<!doctype html>
<html lang="ro">
 <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>filters</title>
</head>
<body>
	
	
<?php

	$i=1;
	foreach(get_defined_constants() as $c => $v) if( str_starts_with(strtolower($c),'filter_')){
		print($i.': '.$c.'<br>');
		$i++;
	}
		
?>
<hr>
<div style="color:red;">OR</div>
<?php

	$i=0;
	foreach(get_defined_constants() as $c => $v) 
		( str_starts_with(strtolower($c),'filter_')) && print(++$i.': '.$c.'<br>');
	
	?>
<hr>
<div style="color:red;">OR</div>
<hr>
<?php
	$i=0;
	array_map(function($c){
		str_starts_with(strtolower($c),'filter_') && print ++$GLOBALS['i'].': '.$c.'<br>';
	},array_keys(get_defined_constants()));
?>
</body>
</html>

:STOP

If you need only the all partial results replace 'filter_' with  'FILTER_VALIDATE_' or 'FILTER_SANITIZE_' don't worry about capitalize or not i put in place strtolower ..

So on EACH SECTION you'll obtain this list:

1: FILTER_FLAG_NONE
2: FILTER_REQUIRE_SCALAR
3: FILTER_REQUIRE_ARRAY
4: FILTER_FORCE_ARRAY
5: FILTER_NULL_ON_FAILURE
6: FILTER_VALIDATE_INT
7: FILTER_VALIDATE_BOOLEAN
8: FILTER_VALIDATE_BOOL
9: FILTER_VALIDATE_FLOAT
10: FILTER_VALIDATE_REGEXP
11: FILTER_VALIDATE_DOMAIN
12: FILTER_VALIDATE_URL
13: FILTER_VALIDATE_EMAIL
14: FILTER_VALIDATE_IP
15: FILTER_VALIDATE_MAC
16: FILTER_DEFAULT
17: FILTER_UNSAFE_RAW
18: FILTER_SANITIZE_STRING
19: FILTER_SANITIZE_STRIPPED
20: FILTER_SANITIZE_ENCODED
21: FILTER_SANITIZE_SPECIAL_CHARS
22: FILTER_SANITIZE_FULL_SPECIAL_CHARS
23: FILTER_SANITIZE_EMAIL
24: FILTER_SANITIZE_URL
25: FILTER_SANITIZE_NUMBER_INT
26: FILTER_SANITIZE_NUMBER_FLOAT
27: FILTER_SANITIZE_ADD_SLASHES
28: FILTER_CALLBACK
29: FILTER_FLAG_ALLOW_OCTAL
30: FILTER_FLAG_ALLOW_HEX
31: FILTER_FLAG_STRIP_LOW
32: FILTER_FLAG_STRIP_HIGH
33: FILTER_FLAG_STRIP_BACKTICK
34: FILTER_FLAG_ENCODE_LOW
35: FILTER_FLAG_ENCODE_HIGH
36: FILTER_FLAG_ENCODE_AMP
37: FILTER_FLAG_NO_ENCODE_QUOTES
38: FILTER_FLAG_EMPTY_STRING_NULL
39: FILTER_FLAG_ALLOW_FRACTION
40: FILTER_FLAG_ALLOW_THOUSAND
41: FILTER_FLAG_ALLOW_SCIENTIFIC
42: FILTER_FLAG_PATH_REQUIRED
43: FILTER_FLAG_QUERY_REQUIRED
44: FILTER_FLAG_IPV4
45: FILTER_FLAG_IPV6
46: FILTER_FLAG_NO_RES_RANGE
47: FILTER_FLAG_NO_PRIV_RANGE
48: FILTER_FLAG_GLOBAL_RANGE
49: FILTER_FLAG_HOSTNAME
50: FILTER_FLAG_EMAIL_UNICODE
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 86.125.181.164)
----
Manual Page -- https://php.net/manual/en/function.filter-var.php
Edit        -- https://main.php.net/note/edit/130173
Del: integrated  -- https://main.php.net/note/delete/130173/integrated
Del: useless     -- https://main.php.net/note/delete/130173/useless
Del: bad code    -- https://main.php.net/note/delete/130173/bad+code
Del: spam        -- https://main.php.net/note/delete/130173/spam
Del: non-english -- https://main.php.net/note/delete/130173/non-english
Del: in docs     -- https://main.php.net/note/delete/130173/in+docs
Del: other reasons-- https://main.php.net/note/delete/130173
Reject      -- https://main.php.net/note/reject/130173
Search      -- https://main.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.