"& #2342;& #2369;& #2312;"
(I have inserted a space between "&" and "#" to stop this from displaying as international text, in my actual string there is no space).
This is a string of escaped characters, length of the string is 21 but it is actually representing something (international text) that is 3 characters.
Now I would like to save these 3 characters to a file. This file should be 6 (3 x 2) bytes long. But, of course, when I use fwrite with the above string I get a file of 21 bytes.
I could parse the string to get the six hex values (23,42,23,69,23,12) that I would need to write, but I can't even get PHP to output true binary. The following:
Expand|Select|Wrap|Line Numbers
- $fh = fopen("text.txt", "wb");
- fwrite($fh, (int)32);