2012-03-23 105 views
0

最初从Java:dumptofile += String.format("%02X", c[icounter]);十六进制字节组串

我将如何得到的,输出回用PHP字符串? (或Python,但Java是不会在目标系统上运行)

+0

参见[sprintf的()](http://php.net/manual/de/function.sprintf.php) – 2012-03-23 13:55:52

+0

你想要一个包含字符0到9和字母A到F的字符串,或者您想要获得字符的ascii(或任何格式)值,例如[this](http://www.asciitable.com/) – thecoshman 2012-03-23 13:55:53

+0

我想从只包含09af的原始字符串中获取任何明文(包括所有\ n等) – jmoon 2012-03-23 13:58:54

回答

0
$str = ''; 
for ($i = 0; $i < count($c)-1; $i+=2) 
    $str .= chr(hexdec($c[$i].$c[$i+1])); 
相关问题