Skip to content

Instantly share code, notes, and snippets.

@poochin
Created September 13, 2010 17:23
Show Gist options
  • Save poochin/577669 to your computer and use it in GitHub Desktop.
Save poochin/577669 to your computer and use it in GitHub Desktop.
<?php
$hieroglyph_qwerty = explode("\n", <<<EOF
1234567890-^\
!"#$%&'()~=~|
qwertyuiop@[
QWERTYUIOP`{
asdfghjkl;:]
ASDFGHJKL+*}
zxcvbnm,./\
ZXCVBNM<>?_
EOF
);
$hieroglyph_dvorak = explode("\n", <<<EOF
1234567890[]
!@#$%^&*(){}
',.pyfgcrl/=
"<>PYFGCRL?+
aoeuidhtns-\
AOEUIDHTNS_|
;qjkxbmwvz
:QJKXBMWVZ
EOF
);
$hieroglyph = array(); // result
for ($line = 0; $line < count($hieroglyph_qwerty) && $line < count($hieroglyph_dvorak); ++$line) {
for ($i = 0; $i < strlen($hieroglyph_qwerty[$line]) || $i < strlen($hieroglyph_dvorak[$line]); ++$i) {
$hieroglyph[] = array(
isset($hieroglyph_qwerty[$line][$i]) ? $hieroglyph_qwerty[$line][$i] : ' ',
isset($hieroglyph_dvorak[$line][$i]) ? $hieroglyph_dvorak[$line][$i] : ' '
);
}
}
unset($hieroglyph_qwerty);
unset($hieroglyph_dvorak);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment