10quality / php-emoji
PHP Emoji coverter library.
Installs: 47
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/10quality/php-emoji
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2025-10-09 06:16:43 UTC
README
Library to convert certain emojis to public svgs (html).
Install
With composer:
composer require 10quality/php-emoji
Usage
Using global functions:
// Following example will return an svg url // -- echos 'https://s.w.org/images/core/emoji/2.3/svg/1f497.svg' echo emoji_to_img('ðŸ’'); // Following example will return an svg wrapped in an image HTML tag // -- echos '<img class="emoji" alt="emoji-heart" src="https://s.w.org/images/core/emoji/2.3/svg/1f497.svg"/>' echo emoji_to_html('ðŸ’');
Using Emoji class:
use TenQuality\Utility\Emoji; /** * @param string First param is the text you want to convert. * @param string Second param is the type of output wanted. */ echo Emoji::convert('ðŸ’', Emoji::URL); echo Emoji::convert('ðŸ’', Emoji::HTML);
Supported Emojis
| Emoji | Characters | Emoji | Characters | 
|---|---|---|---|
| <3 | 💠| ||
| ☕� | :) | ||
| :D | :( | ||
| :'( | :P | ||
| O:) | o.O | ||
| ;) | :O | ||
| -_- | >:O | ||
| :* | ^_^ | ||
| 8-) | 8| | ||
| >:( | ☺ | ||
| (y) | ➡ | 
License
Copyright (c) 2017 10Quality. Under MIT License.