There is a user textarea input. I need to remove all new lines before saving (so it should be only one line).
I use
$text = str_replace("\r\n", "", $text);
$text = str_replace("\n", "", $text);
for this.
But one user entered text, that has new line, and it cannot be removed with that code.
I also tried \r\n
and \r
with no result.
I cannot copy it here, because as soon as I copy it, new line will be replaced with standard \n
.
How can I remove this new line? Or how can I see what its character is?
It is saved in MySQL now.