hasanparasteh / emojiji
A helper class to manipulate emojis
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hasanparasteh/emojiji
Requires
- incenteev/emoji-pattern: ^1.2
README
I really had problem encoding and decoding emojis from utf-8
to utf-16
and vice versa
So I created this package to help me out. Hope you find it useful too :)
composer require hasanparasteh/emojiji
Example
$sampleU8 = "hello 🏦"; $sampleU16 = mb_convert_encoding("hello 🏦", "UTF-16"); echo 'UTF-16 -> UTF-8 encoded emoji: ' . \HP\Emojiji::to_utf_8($sampleU16) . PHP_EOL; echo 'UTF8 -> UTF-16 encoded emoji: ' . \HP\Emojiji::to_utf_16($sampleU8) . PHP_EOL;