V::integer()
Checks for a valid integer
V::integer($value, bool $strict = false): bool
Parameters
Name | Type | Default | Description |
---|---|---|---|
$value |
mixed |
|
|
$strict |
bool |
false |
Return type
bool
In your code
if(v::integer(12)) {
echo 'Yay, valid!';
}
In fields
fields:
example:
label: Example field
type: text
validate: integer