Re: [PHP] How to write binary data to a file?
- Date: Tue, 26 Jul 2016 19:47:12 -0400
- From: David Spector <news@xxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PHP] How to write binary data to a file?
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
Anyway, thank you for the solution, even though PHP is acting very
I consider this question closed now: fwrite can only write strings.
Thanks to everyone for the responses.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php