Dear all,
I need to convert 8 byte floating point (C++ data type: double) files to ASCII value arrays, and be able to create these files from input ascii values.
When I do this:
$filename = "D:\webroot\\new_hyperspectral\speclibformatted\\1sign.esl";
$handle = fopen($filename, "rb");
$contents = fread($handle, 8); // just read one value for now.
// Eventually the whole file needs reading
echo bindec($contents);
it will output 8 individual characters:
¤p= ×#.@
instead of ~ 15.07, which is what I would like to get. I think this is related to the fact that fread creates a string.
I am convinced it should not be hard to do this, and I am obviously missing some detail (!?). How should I approach this?
Thanks!
Jelle.