- json encode an emoji to get its surrogate pair
$surrogate_pair = json_encode(🌊);
print $surrogate_pair; //"\ud83c\udf0a"
- The surrogate pair is the key in the array, check if the key exists and send back the associated keyword. The
$emojis_to_words
variable is an array you need to include in your project.