PHP code example of elvanto / litemoji

1. Go to this page and download the library: Download elvanto/litemoji library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elvanto / litemoji example snippets


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 &#x1F525;! &#x1F603;'

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

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


use LitEmoji\LitEmoji;

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

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

// Add aliases for custom shortcodes
LitEmoji::config('aliasShortcodes', ['yeah' => 'thumbsup']);
echo LitEmoji::encodeUnicode('Can do :yeah:!');
// 'Can do 👍!'