tags:

views:

85

answers:

2

This is basically all I'm doing

echo @file_get_contents("http://******.org/ti.php?i=".$i."&s=".$s);

But when I remove the ti.php file from that server to test if it hides the error I get this in my browser where the error would be:



What the hell is that (lol) ? I've never seen it before and can't think of an explanation of why it would appear, any ideas?

+10  A: 

http://en.wikipedia.org/wiki/Byte-order_mark

It's the BOM of an UTF-8 blank document treated as an iso-8859-1 one.

file_ get_contents generates an error, which isn't displayed, so this is basically a blank UTF-8 document.

Without any charset info, The browser displays it as an iso-8859-1 document as it must be the default setting. So the BOM appears as these strange characters.

EDIT:

Indeed, I copied the three characters of your question, pasted them in a document, looked at the hexadecimal codes: EF BB BF, which is the BOM of UTF-8.

FWH
+1  A: 

To tack onto FWH's answer, make sure you are outputting the content to the browser with the proper encoding in the content-type header.

Easiest way to do this is just to set the default charset

ini_set( 'default_charset', 'UTF-8' );
echo @file_get_contents("http://******.org/ti.php?i=".$i."&s=".$s);

But you can use an explicit header() call if you prefer to.

Peter Bailey