phpemojiemoticons

Emoji name "family_mothers_one_boy" or "woman-woman-boy"?


I have a reference emojis file used by my php code. Inside there is for example "woman-woman-boy", but the browser (chrome) replaces this name by "family_mothers_one_boy"...

NOTE:
The code related to this emoji is:

1F469;‍👩‍&#x1F466


Here are the two functions I'm using to manage the emojis:

1. When I display the emoji, I replace the tage :name: by the HTML rendering (using unicode)

    function replaceEmojiNameByUnicode($inputText){
    $emoji_unicode = getTabEmojiUnicode();
    preg_match_all("/:([a-zA-Z0-9'_+-]+):/", $inputText, $emojis);
    foreach ($emojis[1] as $emojiname) {
        if (isset($emoji_unicode[$emojiname])) {
            $inputText = str_replace(":".$emojiname.":", "&#x".$emoji_unicode[$emojiname].";", $inputText);
        }
        else { 
            $inputText = str_replace(":".$emojiname.":", "(:".$emojiname.":)", $inputText);

        }
    }
    return $inputText;
}

2. When I want to propose the list of emoji I display an HTML SELECT in the page. Teh following function return the list of option to add inside:

/* Display the options in the HTML select */
function displayEmojisOptions(){
    $emoji_unicode = getTabEmojiUnicode();
    foreach ($emoji_unicode as $name => $unicode) {
        echo '<option value="&#x'.$unicode.';">'.$name.' =>  &#x'.$unicode.';</option>';
    }
}
  1. In the array $emoji_unicode there is one entry (with 3 semi-column removed to not display emoji here):

    'family_one_girl' => '1F468;&#x200D&#x1F469&#x200D&#x1F467',

For example: In order to make it works, I have to replace the line 'thinking_face' => '1F914', by 'thinking' => '1F914',

My question is: why ??

Thank you


Solution

  • Nop, the emoji text was changed by no code... I guess it was due to a wrong emoji file I used... I correct all the emoji manually and now I did not see the mismatch anymore... If someone need the corrected file, I can provide it.