Skip to content

Instantly share code, notes, and snippets.

@nikic
Created April 8, 2012 16:29
Show Gist options
  • Save nikic/2338303 to your computer and use it in GitHub Desktop.
Save nikic/2338303 to your computer and use it in GitHub Desktop.
<?php
var_dump(hex2bin("1af8b47f6d8"));
var_dump(hex2bin("01af8b47f6d8")); // left pad
var_dump(hex2bin("1af8b47f6d80")); // right pad
/* OUTPUT
string(5) "→°┤⌂m"
string(6) "☺»ïG÷Ï"
string(6) "→°┤⌂mÇ"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment