Is CR a carriage return?
Why does it show the variable as 2 words (on one line separated by a space) when I dump it?
But it comes out as one long word when I try & put it in an input box. I dont see why the CR replaces the space then
While it might not be relevant to the data shown, is there any reason you’re being inconsistent with the use of single vs. double quotes for the html tags? I know that using double quotes in the php means that you can just stick variable names in line without having to break out of the quotes, it just makes my eyes go funny when trying to figure out if there’s an imbalance. And are you checking somewhere that none of your values contain single quotes?
What happens if you var_dump($message) when you’ve finished building it? In your first example, why was the string showing as 1814 characters long?
I’m assuming you mean in the source rather than when you display the web page? Can you add a “\n” on the end of each time you add a line to $message? I’ve never tried it as the format of the html doesn’t really matter if it’s correct, save for some old browsers reacting badly to white space as I recall.