I see in php.net that there are functions that are said to be binary-safe. for example str_replace
what does it mean binary-safe?
I see in php.net that there are functions that are said to be binary-safe. for example str_replace
what does it mean binary-safe?
It means that every single byte is treated with respect: it won't try and convert a linefeed character 0x13 into a carriage return-linefeed pair 0x10x13 (Windows uses the latter to indicate the end of a line in text files, while Unix uses the former); the string won't be cut short if there's a nul character 0x00 in it (which C uses to indicate the end of a string); it won't zero out the high bit in every byte (since pure ASCII characters are all between 0x00 and 0x7f). Stuff like that.
It means you can use it on binary data without weird manglings happening.