Re: [PHP] reading binary data

2003-06-01 Thread Evan Nemerson
file_get_contents() is binary safe.

$binary_data = file_get_contents(/path/to/file);

php.net/file_get_contents


On Saturday 31 May 2003 12:42 pm, Ferhat BINGOL wrote:
 Hi,

 I have binary data. I know the format but I do not know how to read it with
 PHP. I saw some articles and comments on the manual but it seems taht it is
 not enough for me.

 Anyone to haelp, please?

 I just nedd a good documentation about it.

 TIA

-- 

Everything has a natural explanation. The moon is not a god but a great rock 
and the sun a hot rock.

-Anaxagorus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] reading binary data

2003-06-01 Thread Ferhat BINGOL
I do not understand how to use this one from the manual but thanks I am
working on it. Meanwhile I was trying to open the binary with fopen and
unpack 154 bytes from it (it is the firs line accordint to my structure
format.) I got the first letter but afterwords it just gives stupid
characters.

Do you have any comment on this?

And can you point me an example for file_read_contents???

regards



Evan Nemerson [EMAIL PROTECTED], iletide sunu yazdi
news:[EMAIL PROTECTED]
 file_get_contents() is binary safe.

 $binary_data = file_get_contents(/path/to/file);

 php.net/file_get_contents


 On Saturday 31 May 2003 12:42 pm, Ferhat BINGOL wrote:
  Hi,
 
  I have binary data. I know the format but I do not know how to read it
with
  PHP. I saw some articles and comments on the manual but it seems taht it
is
  not enough for me.
 
  Anyone to haelp, please?
 
  I just nedd a good documentation about it.
 
  TIA

 -- 

 Everything has a natural explanation. The moon is not a god but a great
rock
 and the sun a hot rock.

 -Anaxagorus




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] reading binary data

2003-06-01 Thread Evan Nemerson
/* This example will echo the first 154 bytes of a file
 * (/path/to/file in the example). */
$binary_data = file_get_contents(/path/to/file):
echo substr($binary_data, 0, 154);



On Saturday 31 May 2003 01:29 pm, Ferhat BINGOL wrote:
 I do not understand how to use this one from the manual but thanks I am
 working on it. Meanwhile I was trying to open the binary with fopen and
 unpack 154 bytes from it (it is the firs line accordint to my structure
 format.) I got the first letter but afterwords it just gives stupid
 characters.

 Do you have any comment on this?

 And can you point me an example for file_read_contents???

 regards



 Evan Nemerson [EMAIL PROTECTED], iletide sunu yazdi
 news:[EMAIL PROTECTED]

  file_get_contents() is binary safe.
 
  $binary_data = file_get_contents(/path/to/file);
 
  php.net/file_get_contents
 
  On Saturday 31 May 2003 12:42 pm, Ferhat BINGOL wrote:
   Hi,
  
   I have binary data. I know the format but I do not know how to read it

 with

   PHP. I saw some articles and comments on the manual but it seems taht
   it

 is

   not enough for me.
  
   Anyone to haelp, please?
  
   I just nedd a good documentation about it.
  
   TIA
 
  --
 
  Everything has a natural explanation. The moon is not a god but a great

 rock

  and the sun a hot rock.
 
  -Anaxagorus

-- 

Science has done more for the development of western civilization in one 
hundred years than Christianity did in eighteen hundred years.

-John Burroughs


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] reading binary data

2003-06-01 Thread Ferhat BINGOL
I am getting

NTERRUPT_DURATION

or similar text between the values..

this binary reading thing is dahm jard..



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php