All I can find in the PHP Manual for writing raw bytes to a file is fwrite. But when I use it (opening the file in b mode), it seems to write characters, not raw bytes.
Web searches turn up nothing useful.
I am using a large array of bytes in a file to hold bits, representing members of a large set. Since I manipulate only one bit at a time, I want to read and write the one raw byte that contains the current bit being changed.
The algorithm to do this set manipulationnis simple, but is not relevant to my question, which is: how to write one raw byte (or a larger fixed-length data block) into a file at an offset?