docs/validators/Emoji.md
Emoji()Validates if the input is an emoji or a sequence of emojis.
v::emoji()->assert('๐');
// Validation passes successfully
v::emoji()->assert('๐');
// Validation passes successfully
v::emoji()->assert('โก');
// Validation passes successfully
v::emoji()->assert('๐๐๐๐๐๐๐๐๐๐๐ด');
// Validation passes successfully
v::emoji()->assert('๐ง๐ท'); // (Country flags)
// Validation passes successfully
v::emoji()->assert('๐จโ๐ฉโ๐งโ๐ฆ'); // (ZWJ sequence)
// Validation passes successfully
v::emoji()->assert('๐ฉ๐ฝ'); // (Skin tone modifier)
// Validation passes successfully
v::emoji()->assert('1๏ธโฃ'); // (Keycap sequence)
// Validation passes successfully
v::emoji()->assert('Hello World');
// โ "Hello World" must be an emoji
v::emoji()->assert('this is a spark โก'); // (Mixed content)
// โ "this is a spark โก" must be an emoji
This validator supports:
Emoji::TEMPLATE_STANDARD| Mode | Template |
|---|---|
default | {{subject}} must be an emoji |
inverted | {{subject}} must not be an emoji |
| Placeholder | Description |
|---|---|
subject | The validated input or the custom validator name (if specified). |
| Version | Description |
|---|---|
| 3.0.0 | Renamed to Emoji, changed the behavior, and added support for more emojis |
| 2.0.0 | Created as NotEmoji |