'Replace Emoji with image while preserving it as an Emoji

I'd like to replace Emojis on my website with custom images. That itself would not be a problem in PHP:

$string = "This is a laughing emoji 😂";
echo str_replace($string, "😂", ":'D"); //or replace with an image

However, how do I manage that if someone copies the text, they will be able to copy the text with the emoji and not the replaced image? Like keeping the char 😂 😂 but only changing the outcome so they will look the same for every user. Is that even possible at all?



Solution 1:[1]

No, each system has its own sets of fonts ( including emojis ) which is why they appear different on android vs iOS. The only way you would be able to add something would be outside of the system typeface, i.e. icon sets. You could either include images or links to images.

<img src="imageLocation" alt="altTextorImage">

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1