Skip to content

between

Checks for numbers within the given range

V::between($value, $min, $max): bool

Parameters

Name Type Default
$value * mixed
$min * mixed
$max * mixed

Return type

bool

In your code

if(V::between($input, 5, 20)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      between:
        - 5
        - 20