Skip to content

Instantly share code, notes, and snippets.



Created Sep 25, 2014
What would you like to do?
Convert String to Escaped Hexadecimal Notation
#! /usr/bin/env php
$data = $argv[1];
$split = str_split($data);
foreach($split as $ord) {
echo "\\x" . dechex(ord($ord));
fwrite(STDERR, "\n{$data}\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment