Skip to content

Instantly share code, notes, and snippets.

@wgirhad
Created August 23, 2019 19:21
Show Gist options
  • Save wgirhad/26d7dd8d3eb893531ccb83a49dc1efb9 to your computer and use it in GitHub Desktop.
Save wgirhad/26d7dd8d3eb893531ccb83a49dc1efb9 to your computer and use it in GitHub Desktop.
Convert text to 8bit text emoji
<?php
$dictionary = [
'A' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'B' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'C' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'D' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'E' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'F' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'G' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'H' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'I' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'J' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬛⬜⬜⬜⬛⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'K' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬛⬜⬜⬜
⬜⬛⬛⬜⬛⬜⬜⬜⬜
⬜⬛⬛⬛⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬛⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'L' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'M' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬜⬛⬛⬜⬜
⬜⬛⬛⬜⬛⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'N' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬛⬜⬛⬜⬜
⬜⬛⬛⬜⬛⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'O' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'P' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'Q' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬛⬜⬜⬜
⬜⬜⬛⬛⬛⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'R' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'S' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'T' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'U' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'V' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬜⬛⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'W' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬛⬜⬛⬜⬜
⬜⬛⬛⬜⬛⬜⬛⬜⬜
⬜⬜⬛⬛⬜⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'X' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬜⬛⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬛⬛⬜⬛⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'Y' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬛⬛⬜⬜⬜⬛⬜⬜
⬜⬜⬛⬛⬜⬛⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'Z' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬜⬜
⬜⬜⬜⬜⬛⬛⬜⬜⬜
⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬜⬜⬛⬛⬜⬜⬜⬜⬜
⬜⬛⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,'=' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,')' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬜⬜⬜⬜⬜⬜
⬜⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
,' ' => <<<EOT
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬜
EOT
];
output('Hello world', $dictionary);
function output($str, $dictionary) {
echo implode("\n", array_map(function($char) use ($dictionary) {
return $dictionary[$char];
}, str_split(strtoupper($str)))) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment