Page 1 of 1

open and read a binary file, show contents as hex...

Posted: Sun Jun 22, 2003 12:32 am
by mickey
hello,

i need to open a file and show it's contents as hex...

any ideas how? is there a function in PHP that will do this? byte per byte?

for instance,

$filePointer = fopen("logo.otb", "r");

$byte = fgets($filePointer, 1); // read byte per byte

// now how do i print byte as hex?

many thanks.

Posted: Sun Jun 22, 2003 1:25 am
by volka

Posted: Sun Jun 22, 2003 8:45 am
by mickey
right, thanks a lot. :)