mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 23:35:45 +01:00
20 lines
382 B
Markdown
20 lines
382 B
Markdown
# Unique
|
|
|
|
- `Unique()`
|
|
|
|
Validates whether the input array contains only unique values.
|
|
|
|
```php
|
|
v::unique()->validate([]); // true
|
|
v::unique()->validate([1, 2, 3]); // true
|
|
v::unique()->validate([1, 2, 2, 3]); // false
|
|
v::unique()->validate([1, 2, 3, 1]); // false
|
|
```
|
|
|
|
***
|
|
See also:
|
|
|
|
- [ArrayType](ArrayType.md)
|
|
- [ArrayVal](ArrayVal.md)
|
|
- [Contains](Contains.md)
|
|
- [Each](Each.md)
|