2014-06-10 PHP sprintfで数字を16進文字に変換 PHP $str = sprintf("%dは16進数で0x%X", $num, $num);ネタ元 http://www.phpbook.jp/func/string/index7.html