Methods summary
public static
array[bool]|boolean
|
#
bool( mixed $data )
Check if the data is a boolean Returns TRUE for "1", "true", "on" and "yes".
FALSE is returned only for "0", "false", "off", "no", and "". NULL is returned
for all non-boolean values.
Check if the data is a boolean Returns TRUE for "1", "true", "on" and "yes".
FALSE is returned only for "0", "false", "off", "no", and "". NULL is returned
for all non-boolean values.
Parameters
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
email( array|mixed $data )
Validates value as e-mail.
Validates value as e-mail.
Parameters
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
float( array|mixed $data )
Validates value as float.
Validates value as float.
Parameters
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
int( array|mixed $data, integer $minRange = null, integer $maxRange = null, boolean $allowOctal = false, boolean $allowHexa = false )
Validates value as an integer.
Validates value as an integer.
Parameters
- $data
array|mixed $data
- $minRange
integer $minRange optionnal parameter to set a minimal value
- $maxRange
integer $maxRange optionnal parameter to set a maximal value
- $allowOctal
boolean optionnal parameter to define if octal values are valid
- $allowHexa
boolean optionnal parameter to define if hexadecimal values are valid
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
ip( array|mixed $data, mixed $allowIpv4 = true, mixed $allowIpv6 = true, mixed $allowPrivate = true, mixed $allowReserved = false )
Validates value as IP address, optionally only IPv4 or IPv6 or not from
private or reserved ranges.
Validates value as IP address, optionally only IPv4 or IPv6 or not from
private or reserved ranges.
Parameters
- $data
array|mixed $data
- $allowIpv4
- $allowIpv6
- $allowPrivate
- $allowReserved
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
regularExpression( array|mixed $data )
Validates data against regexp, a Perl-compatible regular expression.
Validates data against regexp, a Perl-compatible regular expression.
Parameters
Returns
array[bool]|boolean
|
public static
array[bool]|boolean
|
#
url( array|mixed $data, mixed $requirePath = false, mixed $requireQuery = false )
Validates value as URL (according to » http://www.faqs.org/rfcs/rfc2396),
optionally with required components. Note that the function will only find ASCII
URLs to be valid; internationalized domain names (containing non-ASCII
characters) will fail.
Validates value as URL (according to » http://www.faqs.org/rfcs/rfc2396),
optionally with required components. Note that the function will only find ASCII
URLs to be valid; internationalized domain names (containing non-ASCII
characters) will fail.
Parameters
- $data
array|mixed $data
- $requirePath
- $requireQuery
Returns
array[bool]|boolean
|
public static
array|string
|
#
validate( array|string $data, integer $filter = FILTER_DEFAULT, mixed $options = null )
validate data
Parameters
- $data
array|string $data
- $filter
integer $filter
- $options
mixed $options
Returns
array|string the sanitized data
|