I have a feeling the answer is \"it\'s not possible,\" but thought I\'d ask to satisfy my curiosity.
I have some code that\'s echoed where the \\n is unavoidable:
<
What about just replacing the "\n
" by a white space (or just nothing, if you already have one space in your incoming string) ?
Like this, for instance :
$str = "Hello\nWorld!";
var_dump($str);
$str = str_replace("\n", ' ', $str);
var_dump($str);
The first output gives :
string 'Hello
World!' (length=12)
And the second one :
string 'HelloWorld!' (length=11)
Is that not enough ?
(Or maybe I don't understand the question well)