respect-validation/docs/rules/StartsWith.md
Henrique Moody 10df3211f5
Add "Categorization" section to rule documentations
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-11 19:16:21 +02:00

807 B

StartsWith

  • StartsWith(mixed $value)
  • StartsWith(mixed $value, bool $identical)

Validates whether the input starts with a given value.

This validator is similar to 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(['lorem', 'ipsum']); // true

true may be passed as a parameter to indicate identical comparison instead of equal.

Message template for this validator includes {{startValue}}.

Categorization

  • Arrays
  • Strings

Changelog

Version Description
0.3.9 Created

See also: