I must write a binary file with php, but I think that I don't use the correct method.
I use this function:
$ptr = fopen("file.txt", 'wb');
fwrite($ptr, $Str);
fclose($ptr);
I write this string (chaotic representation of 0 and 1):
$Str="00000001001110000000000100000100000000000000001000000010000000010000001100000101000000000000010000000001000000000000010100000";
I thought that opening the file with OpenOffice I would not have seen the text of zeros and ones, but instead I was sure I saw a chaotic sequence of characters. Why I see the zeros and ones in open office? How can I do to write the raw data with php?