PHP code example of jsila / emoji-images-php

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

    

jsila / emoji-images-php example snippets


$emoji = new JSila\Twemoji\Twemoji;

echo $emoji->parseText('Today is :sunny: without a single :cloud:.');
// outputs 'Today is <img src="//twemoji.maxcdn.com/16x16/2600.png" alt="black sun with rays" class=""> without a single <img src="//twemoji.maxcdn.com/16x16/2601.png" alt="cloud" class="">.'

$emoji = new JSila\Twemoji\Twemoji(36);

$emoji->getUrl(':sunny:');
// outputs '//twemoji.maxcdn.com/16x16/2600.png' 

$emoji->getImage(':sunny:');
// returns '<img src="//twemoji.maxcdn.com/16x16/2600.png" alt="black sun with rays" class="">' 

$emoji->getImage(':sunny:', 'emoji sunny');
// returns '<img src="//twemoji.maxcdn.com/16x16/2600.png" alt="black sun with rays" class="emoji sunny">' 
 bash
$ composer