I am having trouble reading and writing binary files in PHP with fopen() and fwrite(), which i believed to be binary-safe.
I want to read a file from a remote location and write it to a file locally.
PHP does this, however the bytes 0D and 0A (carriage return and line feed) in the locally-written file are not written correctly - PHP appears to switch carriage returns for linefeeds (0D for 0A), but it is a binary file i want to write!
What am i missing?