Validation
Validating input.
Functions
validate($type, &$value, $convert = true, $extra = null)
Validate $value according to $type.
If $convert is true then $value is modified to be requested type if it is not.
Usually this conversion means converting numeric strings to int or float and
time based strings to DateTime.
Types supported:
string- String validator is also used when
$typeparameter evaluates totruethroughempty($type)
- String validator is also used when
int⇢intfloat⇢floatnumber⇢floatboolnullarrayobjectemailip- Both IPv4 and IPv6 are accepted
ipv4ipv6url- Can be any kind of url, scheme could be
ssh://orhttps://for example
- Can be any kind of url, scheme could be
datetime⇢class DateTime- You can set default timezone by giving
DateTimeZonein$extraparameter
- You can set default timezone by giving
timestamp⇢class DateTime- You can set default timezone by giving
DateTimeZonein$extraparameter
- You can set default timezone by giving
fqdnfqdn-wildcard- Accept FQDN with wildcard at begin (FQDN starting with
*.)
- Accept FQDN with wildcard at begin (FQDN starting with