PHP code example of fdekker / commonmark-ext-emoji

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

    

fdekker / commonmark-ext-emoji example snippets


composer 

// Define your configuration, if needed
$config = [];

// Configure the Environment with all the CommonMark and GFM parsers/renderers
$environment = new Environment($config);
$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new GithubFlavoredMarkdownExtension());
$environment->addExtension(new EmojiExtension(EmojiDataProvider::light()));

$converter = new MarkdownConverter($environment);
echo $converter->convert('Works (y) :thumbsup: (thumbsup)');