PHP code example of elgigi / commonmark-emoji

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

    

elgigi / commonmark-emoji example snippets


use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use ElGigi\CommonMarkEmoji\EmojiExtension;

$converter = new CommonMarkConverter();
$converter->getEnvironment()->addExtension(new EmojiExtension());

echo $converter->convertToHtml('This extension is great :smile:!');