int hexdump ( string $str [ ,int $start=0, int $len=256 ] )
hexdump() dumps a binary data stream into a human-friendly format to the standard output.
※ available F/W version : all
Returns the length of output data, PHP error on error
<?php
$str = "Hello PHPoC";
hexdump($str);
// OUTPUT: 0000 48 65 6c 6c 6f 20 50 48 50 6f 43 |Hello PHPoC |
hexdump($str, 1, 3);
// OUTPUT: 0001 65 6c 6c |ell |
hexdump($str, -5, 3);
// OUTPUT: 0006 50 48 50 |PHP |
?>
Use the following code if the input data length is over the maximum length:
<?php
function hexdump1024($str)
{
for($offset = 0; $offset < strlen($str); )
$offset += hexdump($str, $offset);
return $offset;
}
?>
None
None