OK what im trying to do is unpack some bin2hex data from an xml document and print it into a phpnuke block and i need to be able to apply html formatting to it.
The document being:
http://www.pbbans.com/sigs/142.xml
The printing part works fine, but I can't seem to get a hex2bin function to unpack the data properly.
I've tried quite a few things, this being the latest:
Code:
function hex2bin($hexdata){
for( $i = 0; $i < strlen( $hexdata ); $i += 2 )
eval( '$bindata .= "\x' . substr( $hexdata, $i, 2 ) . '";' );
return $bindata;
}
ob_start();
include("http://www.pbbans.com/sigs/142.xml");
$output = ob_get_contents();
ob_end_clean();
$content = hex2bin($output);
BUT it ends up returning this:
Code:
\x \x <\xGR\xOU\xP_\xNA\xME\x>4g&r6öÇWF–ö<\x/G\xRO\xUP\x_N M>\x \x6g2<\x/G\xRO\xUP\x_T G\x> \x <\xGR\xOU\xP_\xWW\xW>http://www.et-main.com/\x\x \x7wwræWBÖÖ–âæ6öÒ<\x/G\xRO\xUP\x_W\xWW\x_S\xHO\xRT\x> \x <\xHE*\x_A M\xIN\x>4Ö¶fVÆ <\x/Hê _*\xMI\xN>\x \xMakaveli\x \x <\xTO\xTA\xL_\xSE\xRVR\xS>4\x\x \x3<\x/S\xTRê\xMI\xNG\x_SR\xVE\xRS\x> \x <\xTO\xTA\xL_º\xNS\x>3C<\x/T\xOT L\x_B N\xS>\x \x3dd0133d685dfdd6fa3d4053a0ac4205\x \x <\xLA\xST\x_B N\xNE _\xGU\xID\x_E\xIG\xHT\x>63C#<\x/L S\xT_º\xNNí\x_G\xUI _I\xGH\xT>\x \x72.232.53.174:27960\x \x <\xLA\xST\x_B N\xNE _\xNIK\x>4w#e <\x/L S\xT_º\xNNí\x_N\xIC\xK>\x \xMay 06, 2007\x \x\x
Which does have SOME of the information unpacked, but obviously isn't right.
Anyone know where I'm going wrong with this?