PHP code example of marufmax / emoticon-php

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

    

marufmax / emoticon-php example snippets


    $emoji = new \MarufMax\Emoticon\Emoticon();
    
    $emoji->random();  // will display an random emoji ==> 🍕️ 
    $emoji->get('heart'); // it will return an emoji with heart ❤, note: this also support with colon 
    $emoji->get(':heart:');
    $emoji->search('hea'); // This will return an array with all emojies and key name matching with word `hea`
    $emoji->emojify('I like :metal: ');  // It will render the text with metal emoji