i have some codes having the \x00 and \x04 hex codes, what does it means?
$str= implode("\x00", $var['message']); //line 1 $id= $var['message'] . "\x04" . $id; //line 2
what will happen in the line1 and line2 I want to write these into a external file as binary format.
where do i get all information like this.
\x is used to denote an hexadecimal byte. \x00 is thus a byte with all its bits at 0. (As Ryne pointed out, a null character translates to this.) Other examples: \xff is 11111111, \x7f is 01111111, \x80 is 10000000, \x2c is 00101010, etc.
2 Answers. Show activity on this post. A binary file is considered to be just a sequence of bytes - none of them has any special meaning, in the sens that a text-reader would interpret them. \x00 is an example of a specific byte value (HEX 0), that might be interpreted in a special way by a text reader.
\x
indicates hexadecimal notation. See: PHP strings
Have a look at an ASCII table to see what 0x00 and 0x04 represent.
0x00 = NULL 0x04 = EOT (End of transmission)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With