<p>When using the php include function the include is succesfully executed, but it is also outputting a char before the output of the include is outputted, the char is of hex value 3F and I have no idea where it is coming from, although it seems to happen with every include. </p>

<p>At first I thbought it was file encoding, but this doesn't seem to be a problem. I have created a test case to demonstrate it: (<strong>link no longer working</strong>) <a href="http://driveefficiently.com/testinclude.php" rel="noreferrer">http://driveefficiently.com/testinclude.php</a> this file consists of only: </p>

<pre><code>&lt;? include("include.inc"); ?&gt;
</code></pre>

<p>and include.inc consists of only: </p>

<pre><code>&lt;? echo ("hello, world"); ?&gt; 
</code></pre>

<p>and yet, the output is: <em>"?hello, world"</em> where the ? is a char with a random value. It is this value that I do not know the origins of and it is sometimes screwing up my sites a bit. </p>

<p>Any ideas of where this could be coming from? At first I thought it might be something to do with file encoding, but I don't think its a problem.</p>

[{'answer_id': 41655, 'author': 'Thomas Owens', 'author_id': 572, 'author_profile': 'https://Stackoverflow.com/users/572', 'pm_score': 0, 'selected': False, 'text': "<p>I see <code>hello, world</code> on the page you linked to. No problems that I can see...</p>\n\n<p>I'm using Firefox 3.0.1 and Windows XP. What browser/OS are you running? Perhaps that might be the problem.</p>\n"}, {'answer_id': 41667, 'author': 'Leigh Caldwell', 'author_id': 3267, 'author_profile': 'https://Stackoverflow.com/users/3267', 'pm_score': 0, 'selected': False, 'text': "<p>Character 3F actually <em>is</em> the question mark, it isn't just displaying as one.</p>\n\n<p>I get the same results as Thomas, no question mark showing up.</p>\n\n<p>In theory it could be some problem with a web proxy but I am inclined to suspect a stray question mark in your PHP markup...which perhaps you have fixed by now so we don't see the problem.</p>\n"}, {'answer_id': 41678, 'author': 'Mark Biek', 'author_id': 305, 'author_profile': 'https://Stackoverflow.com/users/305', 'pm_score': 1, 'selected': False, 'text': '<p>It doesn\'t show up on the rendered page in Firefox or IE but you can see the funny character when you View Source in IE</p>\n\n<p><img src="https://i.stack.imgur.com/cyPAq.png" alt="enter image description here"></p>\n\n<p>Is this on a Linux machine?  Could you do find &amp; replace with vim or sed to see if you can get rid of the 3F that way?  </p>\n\n<p>If it\'s on Windows, try opening include.inc with Notepad to see if the funny char is visible &amp; can be deleted.</p>\n\n<p>I\'d also be curious to see what happens if you copy the code out of the include and just run it by itself.</p>\n'}, {'answer_id': 41687, 'author': 'Konrad Rudolph', 'author_id': 1968, 'author_profile': 'https://Stackoverflow.com/users/1968', 'pm_score': 2, 'selected': False, 'text': '<p>Your web server (or your text editor) apparently includes a <a href="http://en.wikipedia.org/wiki/Byte_order_mark" rel="nofollow noreferrer">BOM</a> into the document. I don\'t see the rogue character in my browser except when I set the site\'s encoding explicitly to Latin-1. Then, I see two (!) UTF-8 BOMs.</p>\n\n<p>/EDIT: From the fact that there are <em>two</em> BOMs I conclude that the BOM is actually included by your editor at the beginning of the file. What editor do you use? If you use Visual Studio, you\'ve got to say “Save As\xa0…” in the File menu and then choose the button “Save with encoding …”. There, choose “UTF-8 without BOM” or something similar.</p>\n'}, {'answer_id': 41691, 'author': 'grapefrukt', 'author_id': 914, 'author_profile': 'https://Stackoverflow.com/users/914', 'pm_score': 5, 'selected': True, 'text': '<p>What you are seeing is a UTF-8 Byte Order Mark:</p>\n<blockquote>\n<p>The UTF-8 representation of the BOM is the byte sequence EF BB BF, which appears as the ISO-8859-1 characters ï»¿ in most text editors and web browsers not prepared to handle UTF-8.</p>\n<p><a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" rel="noreferrer">Byte Order Mark on Wikipedia</a></p>\n</blockquote>\n<p>PHP does not understand that these characters should be &quot;hidden&quot; and sends these to the browser as if they were normal characters. To get rid of them you will need to open the file using a &quot;proper&quot; text editor that will allow you to save the file as UTF-8 without the leading BOM.</p>\n<p><a href="http://juicystudio.com/article/utf-byte-order-mark.php" rel="noreferrer">You can read more about this problem here</a></p>\n'}, {'answer_id': 41693, 'author': 'DAC', 'author_id': 1111, 'author_profile': 'https://Stackoverflow.com/users/1111', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>I\'d also be curious to see what\n  happens if you copy the code out of\n  the include and just run it by itself.</p>\n</blockquote>\n\n<p>Mark: this is on a shared hosting solution, so I can not get shell access to the file. However, as you can see <a href="http://driveefficiently.com/include.inc" rel="nofollow noreferrer">here</a>, there are no characters that shouldn\'t be there, and running the same file as a script does not produce this char. (The shared hosting company have been of 0 help, continually telling me it is a browser issue).</p>\n'}]
['https://Stackoverflow.com/questions/41647', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1111/']