Re: reading binary data

From: Date: Sat, 31 May 2003 20:40:00 +0000
Subject: Re: reading binary data
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-149679@lists.php.net to get a copy of this message
/* 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" <evan@coeus-group.com>, iletide sunu yazdi > news:200305311316.20609.evan@coeus-group.com... > > > 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

« previous php.general (#149679) next »