I've done some code to parse a binary file. I open the file with fopen and the use fread to parse it byte by byte. My parsing stops when a byte with value 0x1A is encountered. When I read this byte with fread, the resulting string is "". In ASCII table 0x1A belongs to non-printing characters. Could that be the source of the problem?
How can I get the correct value to integer variable? I've tried to do
(int)fread($handle, 1)
intval(fread($handle, 1))
hexdec(fread($handle, 1))
but with no luck.
And yes, I've opened the file with "rb" option.