Re: Use PHP for reading binary files created by C software
| From: | Rasmus Lerdorf | Date: | Mon, 25 Nov 2002 09:28:14 +0000 |
| Subject: | Re: Use PHP for reading binary files created by C software | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125907@lists.php.net to get a copy of this message | ||
php.net/unpack
On Sun, 24 Nov 2002, Tim Molendijk wrote:
> Hi all,
>
> I would like to use PHP to read a binary file which contains a structure in
> C, such as:
> struct simple {
> int a;
> float b;
> };
> with f.e. a = 2 and b = 1.5.
> Please notice that this is stored as *binary* data and not as text.
>
> I know it is possible to read binary files using fgets() in PHP 4.3.0 or
> higher but then I still don't have a clue how to actually *do* it...
> Is it even possible to read binary files created by C software and if so,
> how to do this in practice - examples would be very welcome.
>
> Thanks in advance,
> Tim
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>