The constants below are defined by this extension, and
will only be available when the extension has either
been compiled into PHP or dynamically loaded at runtime.
Returns true for "1",
1 including binary, octal and hexadecimal notations, 1.0 including scientific notation,
"true", true,
"on",
and "yes".
Returns false for "0",
0 including binary, octal and hexadecimal notations, 0.0 including scientific notation,
"false", false,
"off",
"no", and
"".
String values are compared case-insensitively.
The return value for non-boolean values depends on the
FILTER_NULL_ON_FAILURE.
If it is set, null is returned, otherwise false is returned.
A valid URL may not specify the
HTTP protocol (http://).
Therefore, further validation may be required to determine if the
URL uses an expected protocol,
e.g. ssh:// or mailto:.
Warning
This filter only works on ASCII URLs.
This means that Internationalized Domain Names (IDN) will always be rejected.
Warning
This filter is very permissive. For any scheme other than
http:// or https://, host content
will be accepted without any validation, though the presence of a host
is still required unless the URL has a scheme of
mailto:, news:, or
file:. Schemes are not themselves validated and may be
accepted despite not corresponding to a known URL scheme, or having some
other meaning in PHP (like phar://). The
filter also accepts » loopback
addresses that correspond to the current host.
Require hostnames to start with an alphanumeric character and contain
only alphanumerics or hyphens.
Warning
This filter is very permissive. As specified in
» RFC 2181, a valid domain name is
a string with a maximum length of 253 characters (254 if including a
trailing . separator) and where each label (separated
by a .) is at most 63 characters. Unless
FILTER_FLAG_HOSTNAME is used to ensure that the
domain is also a valid host name, whitespace, metacharacters, control
bytes, and even NUL bytes are accepted by the filter.
Validates whether the value is a "valid" e-mail address.
The validation is performed against the addr-spec
syntax in
» RFC 822.
However, comments, whitespace folding, and dotless domain names
are not supported, and thus will be rejected.