Note: FILTER_NULL_ON_FAILURE, FILTER_REQUIRE_SCALAR, FILTER_REQUIRE_ARRAY and FILTER_FORCE_ARRAY dont have prefix "FILTER_FLAG_" but they are FLAGS!
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
INPUT_POST
(int)
INPUT_GET
(int)
INPUT_ENV
(int)
INPUT_SERVER
(int)
INPUT_SESSION
(int)
INPUT_REQUEST
(int)
FILTER_FLAG_NONE
(int)
FILTER_REQUIRE_SCALAR
(int)
FILTER_REQUIRE_ARRAY
(int)
FILTER_FORCE_ARRAY
(int)
FILTER_NULL_ON_FAILURE
(int)
FILTER_VALIDATE_INT
(int)
FILTER_VALIDATE_BOOL
(int)
FILTER_VALIDATE_BOOLEAN
的别名。
FILTER_VALIDATE_BOOLEAN
(int)
FILTER_VALIDATE_FLOAT
(int)
FILTER_VALIDATE_REGEXP
(int)
FILTER_VALIDATE_URL
(int)
FILTER_VALIDATE_DOMAIN
(int)
FILTER_VALIDATE_EMAIL
(int)
FILTER_VALIDATE_IP
(int)
FILTER_VALIDATE_MAC
(int)
FILTER_DEFAULT
(int)
FILTER_UNSAFE_RAW
。
FILTER_UNSAFE_RAW
(int)
FILTER_SANITIZE_STRING
(int)
FILTER_SANITIZE_STRIPPED
(int)
FILTER_SANITIZE_ENCODED
(int)
FILTER_SANITIZE_SPECIAL_CHARS
(int)
FILTER_SANITIZE_EMAIL
(int)
FILTER_SANITIZE_URL
(int)
FILTER_SANITIZE_NUMBER_INT
(int)
FILTER_SANITIZE_NUMBER_FLOAT
(int)
FILTER_SANITIZE_MAGIC_QUOTES
(int)
FILTER_SANITIZE_ADD_SLASHES
替代。)
FILTER_SANITIZE_ADD_SLASHES
(int)
FILTER_CALLBACK
(int)
FILTER_FLAG_ALLOW_OCTAL
(int)
0[0-7]+
)。
FILTER_FLAG_ALLOW_HEX
(int)
0x[0-9a-fA-F]+
)
FILTER_FLAG_STRIP_LOW
(int)
FILTER_FLAG_STRIP_HIGH
(int)
FILTER_FLAG_STRIP_BACKTICK
(int)
FILTER_FLAG_ENCODE_LOW
(int)
FILTER_FLAG_ENCODE_HIGH
(int)
FILTER_FLAG_ENCODE_AMP
(int)
&
编码。
FILTER_FLAG_NO_ENCODE_QUOTES
(int)
'
和 "
编码。
FILTER_FLAG_EMPTY_STRING_NULL
(int)
FILTER_FLAG_ALLOW_FRACTION
(int)
FILTER_FLAG_ALLOW_THOUSAND
(int)
,
)。
FILTER_FLAG_ALLOW_SCIENTIFIC
(int)
e
、E
)。
FILTER_FLAG_PATH_REQUIRED
(int)
FILTER_FLAG_QUERY_REQUIRED
(int)
FILTER_FLAG_SCHEME_REQUIRED
(int)
FILTER_FLAG_HOST_REQUIRED
(int)
FILTER_FLAG_HOSTNAME
(int)
FILTER_FLAG_IPV4
(int)
FILTER_FLAG_IPV6
(int)
FILTER_FLAG_NO_RES_RANGE
(int)
FILTER_FLAG_NO_PRIV_RANGE
(int)
FILTER_FLAG_EMAIL_UNICODE
(int)
Note: FILTER_NULL_ON_FAILURE, FILTER_REQUIRE_SCALAR, FILTER_REQUIRE_ARRAY and FILTER_FORCE_ARRAY dont have prefix "FILTER_FLAG_" but they are FLAGS!
INPUT_REQUEST was implemented in PHP < 8 (it was equal to 99) but it was removed in PHP 8.0
While INPUT_SESSION,FILTER_SANITIZE_MAGIC_QUOTES,FILTER_FLAG_SCHEME_REQUIRED,FILTER_FLAG_HOST_REQUIRED and a few others were removed in PHP 8.0.
Rasmus added FILTER_SANITIZE_FULL_SPECIAL_CHARS to PHP 5.3.3. See
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/
ext/filter/filter.c?r1=297245&r2=297244&pathrev=297245
His earlier commit to the PHP source code trunk commented that this "Added the full htmlspecialchars() functionality which includes utf-8 validation as a default filter."