PHP code example of hasanparasteh / emojiji

1. Go to this page and download the library: Download hasanparasteh/emojiji 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/ */

    

hasanparasteh / emojiji example snippets


$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;