sunaoka / emoji-utility
Utilities for Emoji using PHP
v1.0.2
2024-07-11 08:28 UTC
Requires
- php: ^7.1 || ^8.0
- symfony/polyfill-php80: ^1.28
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
This package is auto-updated.
Last update: 2024-09-05 06:34:20 UTC
README
Library to parse emoji-test.txt
(emoji-test.txt
file provides data for testing which emoji forms should be in keyboards and which should also be displayed/processed).
Installation
composer require sunaoka/emoji-utility
Usage
<?php use Sunaoka\EmojiUtility\Parsers\EmojiTest; $parser = new EmojiTest(); $data = $parser->parse('emoji-test.txt'); var_dump($data);
output is ...
array(4) {
["date"] => string(24) "2023-06-05, 21:39:54 GMT"
["version"] => string(4) "15.1"
["url"] => string(52) "https://unicode.org/Public/emoji/15.1/emoji-test.txt"
["emoji"] => array(5034) {
[0] => array(7) {
["group"] => string(17) "Smileys & Emotion"
["subgroup"] => string(12) "face-smiling"
["codepoints"] => string(5) "1F600"
["status"] => string(15) "fully-qualified"
["emoji"] => string(4) "😀"
["name"] => string(13) "grinning face"
["version"] => string(3) "1.0"
}
:
:
}
}
Options
sort
see: Arrays > Predefined Constants > Sorting order flags.
<?php use Sunaoka\EmojiUtility\Parsers\EmojiTest; $options = [ 'sort' => SORT_ASC, ]; $parser = new EmojiTest(); $data = $parser->parse('emoji-test.txt', $options);