Created
October 18, 2015 13:04
-
-
Save MightyPork/2ed80c7c67f405d2d03a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
dehexify("414D415A494E47"); | |
hexify("Banana."); | |
function dehexify($x) { | |
echo implode('', array_map('chr', array_map('hexdec', explode(',', chunk_split($x, 2, ','))))) . "\n"; | |
} | |
function hexify($x) { | |
echo strtoupper(implode('', array_map('dechex', array_map('ord', str_split($x))))) . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment