class DataFilter (View source)

Methods

static int
filterInteger(array $int, array $min = ~PHP_INT_MAX, array $max = PHP_INT_MAX, array $default = 0)

Filter an integer.

static int
filterPort(array $port, array $default = 80)

Filter a TCP/UDP port

static array
filterBoolean(array $bool, array $default = false)

filter a bool.

Details

static int filterInteger(array $int, array $min = ~PHP_INT_MAX, array $max = PHP_INT_MAX, array $default = 0)

Filter an integer.

This method is a shortcut to filter_var using FILTER_VALIDATE_INT

Parameters

array $int Int to filter
array $min Min value (default to ~PHP_INT_MAX)
array $max Max value (default to PHP_INT_MAX)
array $default Default value

Return Value

int

static int filterPort(array $port, array $default = 80)

Filter a TCP/UDP port

Parameters

array $port
array $default

Return Value

int

static array filterBoolean(array $bool, array $default = false)

filter a bool.

This method is a shortcut to filter_var using FILTER_VALIDATE_BOOLEAN

Parameters

array $bool
array $default

Return Value

array