Numbers
class Numbers (View source)
Methods
bool
integer(mixed $data, int|null $min = null, int|null $max = null)
Tests whether the passed item is an integer.
bool
number(mixed $data, int|float|null $min = null, int|float|null $max = null)
Tests whether the passed item is an integer or a floating point number.
Details
bool
integer(mixed $data, int|null $min = null, int|null $max = null)
Tests whether the passed item is an integer.
Since this is frequently used by the form helper we're not checking whether the TYPE of data is an integer, but whether the passed argument represents a valid text/string version of an integer.
bool
number(mixed $data, int|float|null $min = null, int|float|null $max = null)
Tests whether the passed item is an integer or a floating point number.
Since this is frequently used by the form helper we're not checking whether the TYPE of data is an integer or a float, but whether the passed argument represents a valid text/string version of an integer or a float.