What is the meaning of \x00 , \x04 in PHP

coderex picture coderex · Jul 25, 2009 · Viewed 95.3k times · Source

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.

Answer

Philippe Gerber picture Philippe Gerber · Jul 25, 2009

\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)