Jump to content

parsing binary file


arnoldr

Recommended Posts

Hello together,

 

I am new in php and I try to write an edf parser in php

.edf is a binary coded file with wave forms (looks like that in an editor ÿ¹þqÿñþüþsþÈþþ³þÔþøþïý—ýoý and so on)

what I  tryed see code below

but it did not work even printf doesnt bring an output

normal echo brings same usless output as it looks in an text editor

any idear?

in c# or c++ there is a class called "binary reader" it works good

is there something in php?

 

thanks in advance

 

<?php

$myFile = "demo.edf";
$handle = fopen ($myFile,"rb");

while (!feof($handle))
{
  $data=    fgetc($handle);
  //printf("%c", $data);
  
  echo chr($data) ;
}
fclose($handle);
?>

 

Link to comment
https://forums.phpfreaks.com/topic/125857-parsing-binary-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.