I am providing a web service on a dreamhost server and the client is receiving what looks like a byte order mark in the content body of the script output as follows.
The relevant lines of script code follow.
$msg = ‘’;
global $msg,$errors; //inside validation function
global $msg; //inside db insert function
global $msg; //inside key generate function
$msg .= ‘key=’.functionThatReturnsString(); //inside key generation function
header('Content-Length: ’ . strlen(utf8_decode($msg)));
There cannot be a BOM before the header(string) calls or I would be getting a PHP warning, no? I am not getting any warnings.
Does echo(string) insert a BOM (or other hidden characters) before the string argument?
Can someone tell me how those characters are getting inserted into the content body?
I am clueless. Thanks for your attention.