elvanto/litemoji

A PHP library simplifying the conversion of unicode, HTML and shortcode emoji.

Installs: 2 444 837

Dependents: 3

Suggesters: 0

Security: 0

Stars: 63

Watchers: 5

Forks: 11

Open Issues: 4

4.2.0 2022-05-17 23:16 UTC

This package is auto-updated.

Last update: 2022-09-18 00:03:40 UTC


README

A PHP library simplifying the conversion of unicode, HTML and shortcode emoji.

Run Tests

Installation

$ composer require elvanto/litemoji

Alternatively you can clone or download the library files.

Usage

use LitEmoji\LitEmoji;

echo LitEmoji::encodeShortcode('Baby you light my 🔥! 😃');
// 'Baby you light my :fire:! :smiley:'

echo LitEmoji::encodeHtml('Baby you light my :fire:! :smiley:');
// 'Baby you light my 🔥! 😃'

echo LitEmoji::encodeUnicode('Baby you light my :fire:! :smiley:');
// 'Baby you light my 🔥! 😃'

echo LitEmoji::removeEmoji('Baby you light my 🔥! 😃!!!');
// 'Baby you light my ! !!!'

Configuration

use LitEmoji\LitEmoji;

// Exclude specific shortcodes when converting from unicode and HTML entities
LitEmoji::config('excludeShortcodes', ['mobile', 'android']);

echo LitEmoji::encodeShortcode('📱');
// ':iphone:'

Contributing

Pull requests are welcome. New code must be fully unit tested (the existing test suite can be run with PHPUnit).

License

MIT License