Skip to content

Instantly share code, notes, and snippets.

@donatj

donatj/ordmaker.php

Created Sep 25, 2014
Embed
What would you like to do?
Convert String to Escaped Hexadecimal Notation
#! /usr/bin/env php
<?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