Skip to content

Instantly share code, notes, and snippets.

@jaymollica
Last active July 12, 2024 13:48
Show Gist options
  • Save jaymollica/cf179e0facabbb4ec8cf9e69804b7cb1 to your computer and use it in GitHub Desktop.
Save jaymollica/cf179e0facabbb4ec8cf9e69804b7cb1 to your computer and use it in GitHub Desktop.
Emojis to Words

Emojis to Words

  1. json encode an emoji to get its surrogate pair
$surrogate_pair = json_encode(🌊);
print $surrogate_pair; //"\ud83c\udf0a"
  1. 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.
if(array_key_exists($surrogate_pair, $emojis_to_words)) {
	$keyword = $emojis[$surrogate_pair];
	print $keyword;
}
  1. In this example print $keyword will show you "waves".
<?php
$emojis_to_words = array(
"\ud83d\udca5" => 'explosions',
"\ud83c\udf35" => 'cactus',
"\ud83c\udf82" => 'cakes',
"\ud83c\udf70" => 'cakes',
"\ud83d\udc29" => 'poodles',
"\ud83d\udd25" => 'fires',
"\ud83c\udf2b" => 'fog',
"\ud83c\udf0a" => 'waves',
"\ud83c\udf4f" => 'apples', //green
"\ud83c\udf4e" => 'apples', //red
"\ud83c\udf4b" => 'lemons',
"\ud83c\udf4c" => 'bananas',
"\ud83c\udf47" => 'grapes',
"\ud83c\udf51" => 'butts', // peaches
"\ud83c\udf45" => 'tomatoes',
"\ud83c\udf46" => 'aubregine',
"\ud83e\uddc0" => 'cheese',
"\ud83c\udf55" => 'pizza',
"\ud83c\udf6c" => 'candy',
"\ud83c\udf6d" => 'candy', // lollipop
"\ud83c\udf69" => 'doughnuts',
"\ud83c\udf7a" => 'beer',
"\ud83c\udf7b" => 'beer', // clinking glasses
"\ud83c\udf78" => 'cocktail',
"\ud83c\udf7e" => 'parties', //champaign bottle
"\u2615\ufe0f" => 'coffee',
"\ud83d\udca9" => 'poop',
"\ud83d\udc7b" => 'ghost',
"\ud83e\udd16" => 'robots',
"\ud83d\udca4" => 'sleep', // 'ZZZ'
"\ud83d\udc40" => 'eyes',
"\ud83d\udc83" => 'dancing',
"\ud83d\udc83\ud83c\udffb" => 'dancing',
"\ud83d\udc83\ud83c\udffc" => 'dancing',
"\ud83d\udc83\ud83c\udffd" => 'dancing',
"\ud83d\udc83\ud83c\udffe" => 'dancing',
"\ud83d\udc83\ud83c\udfff" => 'dancing',
"\ud83d\udc54" => 'shirts',
"\ud83d\udc57" => 'dresses',
"\ud83d\udc59" => 'bikinis',
"\ud83d\udc58" => 'kimono',
"\ud83d\udc60" => 'high heels',
"\ud83d\udc52" => 'hats', // woman's hat
"\ud83c\udfa9" => 'top hats', // man's hat
"\ud83d\udc31" => 'dogs',
"\ud83d\udc3b" => 'bears',
"\ud83d\udc31" => 'cats',
"\ud83d\udc36" => 'dogs',
"\ud83d\udc3c" => 'panda',
"\ud83d\udc2f" => 'tigers',
"\ud83e\udd81" => 'lions',
"\ud83d\udc2e" => 'cows',
"\ud83d\udc37" => 'pigs',
"\ud83d\udc19" => 'octopus',
"\ud83d\udc35" => 'monkeys',
"\ud83d\udc12" => 'monkeys',
"\ud83d\udc14" => 'chicken',
"\ud83d\udc26" => 'birds',
"\ud83d\udc34" => 'horses',
"\ud83e\udd84" => 'unicorns',
"\ud83d\udc1d" => 'bees',
"\ud83d\udc22" => 'turtles',
"\ud83d\udc20" => 'fish', // tropical
"\ud83d\udc10" => 'goats',
"\ud83d\udd4a" => 'peace', // dove
"\ud83d\udc15" => 'cats', // profile
"\ud83d\udc08" => 'dogs', // profile
"\ud83d\udc09" => 'dragon', // profile
"\ud83d\udc32" => 'dragon', // face
"\ud83c\udf84" => 'christmas tree',
"\ud83c\udf40" => 'clover',
"\ud83c\udf3b" => 'sunflower',
"\ud83c\udf39" => 'tulip',
"\ud83d\udc90" => 'flowers',
"\ud83c\udf44" => 'mushroom',
"\u2600\ufe0f" => 'sunlight',
"\ud83c\udf27" => 'rain;',
"\u26bd\ufe0f" => 'soccer',
"\ud83c\udfc0" => 'basketball',
"\ud83c\udfc8" => 'football',
"\u26be\ufe0f" => 'baseball',
"\ud83c\udfbe" => 'tennis',
"\ud83c\udfd2" => 'hockey',
"\u26f7" => 'skiing',
"\ud83c\udfc4" => 'surfer',
"\ud83c\udfca" => 'swimming',
"\ud83d\udeb4" => 'bicycle',
"\ud83c\udfad" => 'theater', // dramatic masks
"\ud83c\udfa8" => 'abstract', // artist's palette
"\ud83c\udfb7" => 'saxophone',
"\ud83c\udfba" => 'trumpet',
"\ud83c\udfb8" => 'guitar',
"\ud83c\udfbb" => 'violin',
"\ud83c\udfb0" => 'casino',
"\ud83c\udfb3" => 'bowling',
"\ud83d\ude97" => 'cars',
"\ud83d\ude95" => 'taxi',
"\ud83d\ude8c" => 'buses',
"\ud83d\ude8e" => 'public transportation',
"\ud83d\ude91" => 'ambulance',
"\ud83d\ude92" => 'firefighter',
"\ud83d\ude9c" => 'tractor',
"\ud83d\ude82" => 'trains',
"\ud83d\ude82" => 'helicopter',
"\u2708\ufe0f" => 'airplane',
"\u26f5\ufe0f" => 'sailboat',
"\ud83d\udef0" => 'satellites',
"\ud83c\udf01" => 'fog',
"\ud83c\udf0b" => 'volcano',
"\ud83c\udfde" => 'national park',
"\ud83c\udf05" => 'sunrise',
"\ud83c\udf86" => 'fireworks',
"\ud83c\udf08" => 'rainbow',
"\ud83c\udfe0" => 'houses',
"\ud83c\udfe5" => 'hospitals',
"\ud83c\udfeb" => 'school',
"\u231a\ufe0f" => 'watches',
"\ud83d\udcf1" => 'cell phone',
"\ud83d\udda5" => 'computers',
"\ud83d\udcbe" => 'computer disks',
"\ud83d\udcfc" => 'cassette',
"\ud83c\udfa5" => 'film',
"\u260e\ufe0f" => 'telephones',
"\ud83d\udcfa" => 'television',
"\ud83d\udcfb" => 'radios',
"\ud83d\udce1" => 'satellite dish',
"\ud83d\udd6f" => 'candles',
"\ud83d\udcb0" => 'money',
"\ud83d\udc8e" => 'jewels',
"\ud83d\udeac" => 'cigarettes',
"\u26b0" => 'coffins',
"\ud83d\udd2e" => 'fortune teller',
"\ud83d\udc88" => 'barber',
"\ud83d\udebd" => 'toilets',
"\ud83d\udd11" => 'keys',
"\ud83d\udecf" => 'beds',
"\ud83c\udf89" => 'parties', // party popper
"\ud83c\udf8a" => 'parties', // confetti
"\u2764\ufe0f" => 'hearts', // red heart
"\ud83e\udd21" => 'clowns',
"\ud83d\ude00" => 'smiling',
"\ud83d\ude2c" => 'grimaces',
"\ud83d\ude01" => 'smiling',
"\ud83d\ude02" => 'laughing',
"\ud83d\ude03" => 'smiling',
"\ud83d\ude04" => 'smiling',
"\ud83d\ude05" => 'smiling',
"\ud83d\ude06" => 'smiling',
"\ud83d\ude07" => 'smiling',
"\ud83d\ude09" => 'secrets',
"\ud83d\ude0a" => 'smiling',
"\ud83d\ude42" => 'smiling',
"\ud83d\ude43" => 'upsidedown',
"\u263a\ufe0f" => 'smiling',
"\ud83d\ude0b" => 'eating',
"\ud83d\ude0c" => 'smiling',
"\ud83d\ude0d" => 'love',
"\ud83d\ude18" => 'kissing',
"\ud83d\ude17" => 'kissing',
"\ud83d\ude19" => 'kissing',
"\ud83d\ude1a" => 'kissing',
"\ud83d\ude1c" => 'tongues',
"\ud83d\ude1d" => 'tongues',
"\ud83d\ude1b" => 'tongues',
"\ud83e\udd11" => 'wealth',
"\ud83e\udd13" => 'nerds',
"\ud83d\ude0e" => 'sunglasses',
"\ud83e\udd17" => 'smiling',
"\ud83d\ude0f" => 'smiling',
"\ud83d\ude36" => 'quiet',
"\ud83d\ude10" => 'staring',
"\ud83d\ude11" => 'staring',
"\ud83d\ude12" => 'frown',
"\ud83d\ude44" => 'looking up',
"\ud83e\udd14" => 'thinking',
"\ud83d\ude33" => 'staring',
"\ud83d\ude1f" => 'frown',
"\ud83d\ude20" => 'yelling',
"\ud83d\ude14" => 'pensive',
"\ud83d\ude15" => 'puzzle',
"\ud83d\ude41" => 'staring',
"\u2639\ufe0f" => 'frown',
"\ud83d\ude23" => 'struggle',
"\ud83d\ude2b" => 'frown',
"\ud83d\ude29" => 'frown',
"\ud83d\ude31" => 'crying',
"\ud83d\ude28" => 'fear',
"\ud83d\ude30" => 'fear',
"\ud83d\ude2f" => 'quiet',
"\ud83d\ude26" => 'frown',
"\ud83d\ude22" => 'tears',
"\ud83d\ude2a" => 'tears',
"\ud83d\ude13" => 'tears',
"\ud83d\ude2d" => 'crying',
"\ud83d\ude35" => 'dizzy',
"\ud83d\ude32" => 'astonished',
"\ud83e\udd10" => 'zipper',
"\ud83d\ude37" => 'illness',
"\ud83e\udd12" => 'illness',
"\ud83e\udd15" => 'wounds',
"\ud83d\ude34" => 'sleeping',
"\ud83d\udc80" => 'skulls',
"\u2620\ufe0f" => 'skulls',
"\ud83d\udc7d" => 'aliens',
"\ud83d\ude3a" => 'cats',
"\ud83d\ude38" => 'cats',
"\ud83d\ude39" => 'laughing',
"\ud83d\ude3b" => 'love',
"\ud83d\ude3c" => 'cats',
"\ud83d\ude3d" => 'kissing',
"\ud83d\ude40" => 'fear',
"\ud83d\ude3f" => 'crying',
"\ud83d\ude3e" => 'cats',
"\ud83d\udc44" => 'lips',
"\ud83d\udc8b" => 'kissing',
"\ud83d\udc45" => 'tongues',
"\ud83d\udde3" => 'talking',
"\ud83d\udc64" => 'silhouettes',
"\ud83d\udc65" => 'silhouettes',
"\ud83d\udc56" => 'pants',
"\ud83d\udc63" => 'footprints',
"\ud83d\udc61" => 'sandals',
"\ud83d\udc62" => 'boots',
"\ud83d\udc5e" => 'shoes',
"\ud83d\udc5f" => 'sneakers',
"\ud83c\udf93" => 'graduation',
"\ud83d\udc51" => 'crowns',
"\ud83d\udc5c" => 'purses',
"\ud83d\udc5b" => 'purses',
"\ud83d\udcbc" => 'briefcases',
"\ud83d\udc53" => 'glasses',
"\ud83d\udd76" => 'sunglasses',
"\ud83d\udc8d" => 'rings',
"\ud83c\udf02" => 'umbrellas',
"\u2744\ufe0f" => 'snow',
"\ud83c\udf2a" => 'tornados',
"\u26a1\ufe0f" => 'lightning',
"\ud83e\udd51" => 'avocados',
"\ud83e\udd8b" => 'butterflies',
"\ud83d\ude48" => 'monkeys',
"\ud83d\ude49" => 'monkeys',
"\ud83d\ude4a" => 'monkeys',
"\ud83d\udc27" => 'penguins',
"\ud83d\udd77" => 'spiders',
"\ud83e\udd82" => 'scorpions',
"\ud83e\udd80" => 'crabs',
"\ud83d\udc0d" => 'snakes',
"\ud83d\udc1b" => 'bugs',
"\ud83d\udc0c" => 'snails',
"\ud83d\udc1e" => 'ladybug',
"\ud83d\udc1c" => 'ants',
"\ud83d\udc1f" => 'fish',
"\ud83d\udc21" => 'blowfish',
"\ud83d\udc2c" => 'dolphin',
"\ud83d\udc33" => 'whale',
"\ud83d\udc0b" => 'whale',
"\ud83d\udc0a" => 'crocodile',
"\ud83d\udc06" => 'leopard',
"\ud83c\udf32" => 'pine tree',
"\ud83c\udf33" => 'trees',
"\ud83c\udf34" => 'palm tree',
"\ud83c\udf31" => 'seedling',
"\ud83c\udf3f" => 'herbs',
"\ud83c\udf43" => 'leaves',
"\ud83c\udf42" => 'leaves',
"\ud83c\udf41" => 'leaves',
"\ud83c\udf3a" => 'flowers', // hibiscus
"\ud83c\udf3c" => 'blossom',
"\ud83c\udf38" => 'blossom',
"\ud83c\udf30" => 'chestnut',
"\ud83c\udf83" => 'halloween', // jack-o-lantern
"\ud83d\udc1a" => 'seashells',
"\ud83d\udd78" => 'webs;',
"\ud83c\udf0e" => 'globes',
"\ud83c\udf0d" => 'globes',
"\ud83c\udf0f" => 'globes',
"\ud83c\udf15" => 'moons',
"\ud83c\udf16" => 'moons',
"\ud83c\udf17" => 'moons',
"\ud83c\udf18" => 'moons',
"\ud83c\udf11" => 'moons',
"\ud83c\udf12" => 'moons',
"\ud83c\udf13" => 'moons',
"\ud83c\udf14" => 'moons',
"\ud83c\udf1a" => 'moons',
"\ud83c\udf1d" => 'moons',
"\ud83c\udf1b" => 'crescents',
"\ud83c\udf1c" => 'crescents',
"\ud83c\udf1e" => 'sunshine',
"\ud83c\udf19" => 'crescents',
"\u2b50\ufe0f" => 'stars',
"\ud83c\udf1f" => 'stars',
"\ud83d\udcab" => 'stars',
"\u2728" => 'stars',
"\u2604\ufe0f" => 'comets',
"\ud83c\udf54" => 'hamburger',
"\ud83c\udf73" => 'cooking',
"\ud83c\udf5f" => 'french fries',
"\ud83c\udf2d" => 'hot dog',
"\ud83c\udf5d" => 'spaghetti',
"\ud83c\udf2e" => 'tacos',
"\ud83c\udf2f" => 'burritos',
"\ud83c\udf63" => 'sushi',
"\ud83c\udf68" => 'sundae',
"\ud83c\udf66" => 'ice cream',
"\ud83c\udf77" => 'wine',
"\ud83c\udf79" => 'cocktail',
"\ud83c\udfc6" => 'trophies',
"\ud83c\udfaa" => 'circus',
"\ud83c\udfb9" => 'pianos',
"\ud83d\ude80" => 'rocket',
"\u26f2\ufe0f" => 'fountain',
"\ud83c\udfa2" => 'roller coaster',
"\u26f0" => 'mountains',
"\ud83c\udfd4" => 'mountains',
"\ud83d\uddfb" => 'mountains',
"\ud83d\udcaf" => '100', //100
"\ud83c\udfb5" => 'music',
"\ud83c\udfb6" => 'music',
"\ud83d\udcac" => 'talking',
"\ud83d\udcad" => 'thinking',
"\ud83d\uddef" => 'yelling',
"\ud83c\udccf" => 'playing cards',
"\ud83c\udff3\ufe0f\u200d\ud83c\udf08" => 'gay rights', // rainbow flag
"\ud83e\udd53" => 'bacon',
"\ud83e\udd43" => 'liquor', // whiskey glass
"\ud83c\udfa4" => 'microphones',
"\ud83d\udea8" => 'sirens',
"\ud83c\udfcd" => 'motorcycle',
"\ud83c\udfd5" => 'camping',
"\u26fa\ufe0f" => 'camping',
"\ud83c\udfdc" => 'deserts',
"\ud83c\udfd6" => 'sunbathing', // island with umbrella
"\ud83c\udfdd" => 'tropical', // island with palm trees
"\ud83c\udf07" => 'cityscapes',
"\ud83c\udf06" => 'cityscapes',
"\ud83c\udfd9" => 'cityscapes',
"\ud83c\udf03" => 'cityscapes',
"\ud83c\udfd8" => 'houses',
"\ud83c\udfe1" => 'houses',
"\ud83c\udfe2" => 'office buildings',
"\ud83d\udd28" => 'hammers',
"\u2699" => 'gears',
"\ud83d\udd2b" => 'guns',
"\ud83d\udca3" => 'bombs',
"\ud83d\udd2a" => 'knives',
"\ud83d\udc8a" => 'pharmaceuticals',
"\ud83d\udd73" => 'holes',
"\ud83d\udc89" => 'blood',
"\ud83d\udec1" => 'showers',
"\u26f1" => 'umbrellas',
"\ud83c\udf81" => 'gifts',
"\ud83c\udf88" => 'baloons',
"\ud83c\udf80" => 'ribbons',
"\ud83d\udcc5" => 'calendars',
"\ud83d\uddf3" => 'voting',
"\ud83d\udcda" => 'books',
"\u270f\ufe0f" => 'pencils',
"\u26aa\ufe0f" => 'circles', // white
"\u26ab\ufe0f" => 'circles', //black
"\u2b1b\ufe0f" => 'squares', //black
"\u2b1c\ufe0f" => 'squares', //white
"\ud83d\uddbc" => 'frames',
"\ud83c\udfda" => 'delapidated',
"\ud83c\udfed" => 'factories',
"\ud83d\udd32" => 'minimalism', // black border white square
"\ud83d\udd33" => 'minimalism', // white border black square
"\ud83c\udfb1" => 'pool table',
"\ud83d\udd3a" => 'triangles', // up
"\ud83d\udd3b" => 'triangles', // down
"\ud83d\udca6" => 'sweating',
"\u26f3\ufe0f" => 'golfing',
"\ud83c\udfdf" => 'stadiums',
"\ud83d\udca1" => 'lightbulbs',
"\ud83d\udd2d" => 'telescopes',
"\ud83d\udd2c" => 'microscopes',
"\ud83d\udd70" => 'clocks',
"\ud83d\udc2a" => 'camels',
"\ud83d\udc2b" => 'camels',
"\ud83d\udc18" => 'elephants',
"\ud83d\udc38" => 'frogs',
"\ud83d\udc30" => 'rabbits',
"\ud83d\udc2d" => 'mice',
"\ud83d\udeaa" => 'doors',
"\ud83d\udecd" => 'shopping',
"\ud83d\udc41" => 'eyeballs',
"\ud83c\udf53" => 'strawberries',
"\ud83c\udf52" => 'cherries',
"\ud83c\udf36" => 'peppers',
"\ud83c\udf3d" => 'corn;',
"\ud83c\udf60" => 'potato',
"\ud83c\udf6f" => 'honey',
"\ud83c\udf5e" => 'bread',
"\ud83c\udf6b" => 'chocolate',
"\ud83c\udf7f" => 'popcorn',
"\ud83c\udf6a" => 'cookies',
"\ud83c\udf4a" => 'oranges',
"\ud83c\udff9" => 'archery',
"\ud83d\udc6f" => 'friends', // two women with bunny ears
"\ud83d\udc6f\u200d\u2642\ufe0f" => 'friends', // two men with bunny ears
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment