1. Go to this page and download the library: Download anisimov/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/ */
anisimov / emoji example snippets
$delimiter = new \Anisimov\Emoji\Delimiter\SingleColonDelimiter();
$emoji = new \Anisimov\Emoji\Emoji($delimiter);
$stringWithEmoji = 'some string 😉';
$result = $emoji->encode($stringWithEmoji); // some string :wink:
$stringWithEncodedEmoji = 'some string :wink:';
$result = $emoji->decode($stringWithEmoji); // some string 😉
$delimiter = new \Anisimov\Emoji\Delimiter\DoubleColonDelimiter();
$emoji = new \Anisimov\Emoji\Emoji($delimiter);
$stringWithEmoji = 'some string 😉';
$result = $emoji->encode($stringWithEmoji); // some string ::wink::
$stringWithEncodedEmoji = 'some string ::wink::';
$result = $emoji->decode($stringWithEmoji); // some string 😉
$delimiter = new \Anisimov\Emoji\Delimiter\TripleColonDelimiter();
$emoji = new \Anisimov\Emoji\Emoji($delimiter);
$stringWithEmoji = 'some string 😉';
$result = $emoji->encode($stringWithEmoji); // some string :::wink:::
$stringWithEncodedEmoji = 'some string :::wink:::';
$result = $emoji->decode($stringWithEmoji); // some string 😉