Skip to content

Instantly share code, notes, and snippets.

@r3dsm0k3
Created March 1, 2012 11:58
Show Gist options
  • Save r3dsm0k3/1949346 to your computer and use it in GitHub Desktop.
Save r3dsm0k3/1949346 to your computer and use it in GitHub Desktop.
Sucker Strings
<?php
$array = array('\x4f\160\x65\162\x61\40\x4d\151\x6e\151');
foreach ($array as $key => $value) {
// doesn't work.
$array[$key] = "$value";
// doesn't work
$array[$key] = sprintf($value);
}
//Why does this display Opera Mini ?
echo "\x4f\160\x65\162\x61\40\x4d\151\x6e\151";
echo "<br/>";
//Why doesnt the array[1] display Opera Mini ?
print_r($array);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment