Symbol with HEX code 0

Hello. There is a PHP file that creates an xml file

print '<?xml version="1.0" encoding="windows-1251"?>';

It used to create it normally, the first line of the output file was:

<?xml version="1.0" encoding="windows-1251"?>

now (perhaps with a server update or something else) the first term is empty and the file starts from the second one, in the HEX editor you can see that the empty line becomes the 0A character, it was not in the created file before. What could cause this?


There is the following code before the print line:

function ExportCML($order_id)
if (!int($order_id)) return false;
//        " "  1
list($ext_company_id, $ext_catalogue_id) = explode(" ",
value1("SELECT external_id
      FROM Netshop_ImportSources 
      WHERE source_id='".$this->CartContents[0]["ImportSourceID"]."'"));
header("Content-Type: Aplication/xml-file");
header("Content-Disposition: attachment; filename=order{$this->OrderID}.xml");

Answer 1, authority 100%

Probably at the beginning of the file before <?phpor <?there is an extra newline, check the very beginning of your file

Answer 2

Perhaps, before creating the header of the XML file, there is already an output to the file – you need to look at the code above this line.

Answer 3

Only the HEX editor helped. It removed this working CODE. I read about him that he is a label for encoding, but I can’t find what exactly he does, the second time.
P.S. Found, most likely this is due to BOM (Byte Order Mark) for UTF-8 encoding.
But why at the beginning of the file there is only one carriage return character, I did not understand.