in
Checks if the value exists in a list of given values
V::in($value, array $in, bool $strict = false): bool
Parameters
Name | Type | Default |
---|---|---|
$valuerequired | mixed |
no default value |
$inrequired | array |
no default value |
$strict | bool |
false
|
Return type
bool
In your code
if (V::in('A', ['A', 'B', 'C'])) {
echo 'Yay, valid!';
}
In fields
fields:
example:
label: Example field
type: text
validate:
in:
- A
- B
- C