respect-validation/docs/Contains.md

29 lines
496 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Contains
- `Contains(mixed $value)`
- `Contains(mixed $value, bool $identical)`
2015-01-30 09:40:06 +01:00
For strings:
```php
v::contains('ipsum')->validate('lorem ipsum'); // true
2015-01-30 09:40:06 +01:00
```
For arrays:
```php
v::contains('ipsum')->validate(['ipsum', 'lorem']); // true
2015-01-30 09:40:06 +01:00
```
A second parameter may be passed for identical comparison instead
of equal comparison.
Message template for this validator includes `{{containsValue}}`.
***
2015-01-30 09:40:06 +01:00
See also:
* [StartsWith](StartsWith.md)
* [EndsWith](EndsWith.md)
* [In](In.md)