mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 15:50:03 +01:00
632 B
632 B
StartsWith
v::startsWith(mixed $value)v::startsWith(mixed $value, boolean $identical = false)
This validator is similar to v::contains(), but validates
only if the value is at the beginning of the input.
For strings:
v::startsWith('lorem')->validate('lorem ipsum'); //true
For arrays:
v::startsWith('lorem')->validate(array('lorem', 'ipsum')); //true
true may be passed as a parameter to indicate identical comparison
instead of equal.
Message template for this validator includes {{startValue}}.
See also: