Re: How to write binary data to a file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shiplu,

fprintf($Res, "%c", $IDByte);

worked. It actually wrote a byte containing 0b1. Whew.

Clearly, the problem was with fwrite converting its value to a character. It shouldn't do this, IMO, since fwrite is documented as working both for string and binary arguments (depending on the 'b' mode of fopen).

Anyway, thank you for the solution, even though PHP is acting very non-intuitively here.

I consider this question closed now: fwrite can only write strings. Thanks to everyone for the responses.

David

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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux