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 - Manual: 预定义常量
2024-11-14
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
INPUT_POST
(integer)
INPUT_GET
(integer)
INPUT_ENV
(integer)
INPUT_SERVER
(integer)
INPUT_SESSION
(integer)
INPUT_REQUEST
(integer)
FILTER_FLAG_NONE
(integer)
FILTER_REQUIRE_SCALAR
(integer)
FILTER_REQUIRE_ARRAY
(integer)
FILTER_FORCE_ARRAY
(integer)
FILTER_NULL_ON_FAILURE
(integer)
FILTER_VALIDATE_INT
(integer)
FILTER_VALIDATE_BOOLEAN
(integer)
FILTER_VALIDATE_FLOAT
(integer)
FILTER_VALIDATE_REGEXP
(integer)
FILTER_VALIDATE_URL
(integer)
FILTER_VALIDATE_EMAIL
(integer)
FILTER_VALIDATE_IP
(integer)
FILTER_VALIDATE_MAC
(integer)
FILTER_DEFAULT
(integer)
FILTER_UNSAFE_RAW
。
FILTER_UNSAFE_RAW
(integer)
FILTER_SANITIZE_STRING
(integer)
FILTER_SANITIZE_STRIPPED
(integer)
FILTER_SANITIZE_ENCODED
(integer)
FILTER_SANITIZE_SPECIAL_CHARS
(integer)
FILTER_SANITIZE_EMAIL
(integer)
FILTER_SANITIZE_URL
(integer)
FILTER_SANITIZE_NUMBER_INT
(integer)
FILTER_SANITIZE_NUMBER_FLOAT
(integer)
FILTER_SANITIZE_MAGIC_QUOTES
(integer)
FILTER_CALLBACK
(integer)
FILTER_FLAG_ALLOW_OCTAL
(integer)
0[0-7]+
)。
FILTER_FLAG_ALLOW_HEX
(integer)
0x[0-9a-fA-F]+
)
FILTER_FLAG_STRIP_LOW
(integer)
FILTER_FLAG_STRIP_HIGH
(integer)
FILTER_FLAG_ENCODE_LOW
(integer)
FILTER_FLAG_ENCODE_HIGH
(integer)
FILTER_FLAG_ENCODE_AMP
(integer)
&
编码。
FILTER_FLAG_NO_ENCODE_QUOTES
(integer)
'
和 "
编码。
FILTER_FLAG_EMPTY_STRING_NULL
(integer)
FILTER_FLAG_ALLOW_FRACTION
(integer)
FILTER_FLAG_ALLOW_THOUSAND
(integer)
,
)。
FILTER_FLAG_ALLOW_SCIENTIFIC
(integer)
e
、E
)。
FILTER_FLAG_PATH_REQUIRED
(integer)
FILTER_FLAG_QUERY_REQUIRED
(integer)
FILTER_FLAG_IPV4
(integer)
FILTER_FLAG_IPV6
(integer)
FILTER_FLAG_NO_RES_RANGE
(integer)
FILTER_FLAG_NO_PRIV_RANGE
(integer)
FILTER_FLAG_EMAIL_UNICODE
(integer)
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."