Download the PHP package maximal/emoji without Composer
On this page you can find all versions of the php package maximal/emoji. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maximal/emoji
More information about maximal/emoji
Files in maximal/emoji
Package emoji
Short Description Emoji Detecting and Processing with no dependencies
License MIT
Informations about the package emoji
Emoji Detecting and Processing
Unicode version: 15.0.
Installation
Install this library using the Composer require
command:
or add the package name to the require
section of your composer.json
file:
and then run:
Then include Composer autoload anywhere in your code:
Usage
containsEmoji($string): bool
Detects whether the given string contains one or more emoji characters.
onlyEmoji($string, $ignoreWhitespace = true): bool
Detects whether the given string consists of emoji characters only.
This method ignores any spaces, tabs and other whitespace characters (\s
).
Pass false
to the second parameter for not ignoring whitespace characters.
removeEmoji($string): string
Returns the given string with all emoji characters removed.
allEmojis($string): array
Returns an array of all emojis of the input string.
startingEmojis($string, $ignoreWhitespace = true): array
Returns an array of starting emojis of the input string.
This method ignores any spaces, tabs and other whitespace characters (\s
).
Pass false
to the second parameter for not ignoring whitespace characters.
Tests
Run simple tests:
Expected output:
Contact the author
- Website: https://maximals.ru (Russian)
- Twitter: https://twitter.com/almaximal
- Telegram: https://t.me/maximal
- Sijeko Company: https://sijeko.ru (web, mobile, desktop applications development and graphic design)
- Personal GitHub: https://github.com/maximal
- Company’s GitHub: https://github.com/sijeko