PHP code example of rjwu123 / emoji

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

    

rjwu123 / emoji example snippets




use rjwu123\emoji\Emoji;

$testStr = "my heart is broken 💔" ;

$emoji = new Emoji(new UnicodeConvert()) ;

$ecodeStr = $emoji->encode($testStr) ;

$decodeStr =  $emoji->decode($ecodeStr) ;

echo $ecodeStr."\n\n" ;
echo $decodeStr."\n\n" ;