Skip to content

Instantly share code, notes, and snippets.

@matejb
Created January 29, 2012 18:41
Show Gist options
  • Select an option

  • Save matejb/1700070 to your computer and use it in GitHub Desktop.

Select an option

Save matejb/1700070 to your computer and use it in GitHub Desktop.
String ASCII echo
$sub = str_split(substr($input_string, 0, 400));
$chars = '';
$ords = '';
foreach ($sub as $character)
{
if ($character == "\n" || $character == "\r")
continue;
$chars .= $character . ' ';
$ords .= ord($character) . "\t";
if (strlen($chars) > 20)
{
echo $chars . "\t|\t" . $ords . "\n";
$chars = '';
$ords = '';
}
}
echo "----------------------------------------------------\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment