$sanitizer→option()
Return $value if it exists in $allowedValues, or null if it doesn't
Usage
// basic usage
$string = $sanitizer->option($value);
// usage with all arguments
$string = $sanitizer->option($value, array $allowedValues = []);Arguments
| Name | Type(s) | Description |
|---|---|---|
$value | string int | |
$allowedValues (optional) | array | Whitelist of option values that are allowed |
Return value
string int null
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.252