Ello chaps.
Ok - clear the line as follows:
$clean_string = preg_replace("/[\n\r]/"," ",trim($dirty_string));
.. Take it to the screen and it works - one beautiful big piece of text without a new line.
INSERT it in a field like LONGTEXT in MySQL - then view the received data in Sequel Pro - and for some reason it has new lines. Loads them, as and when it was new, before I cleaned it.
What am I doing wrong? Is it LONGTEXT?
This is what the HTML source looks like when I use the contents of an SO page as a string - pay attention to many spaces and translation strings even when clearing!
mysql - Trouble with CONCAT and Longtext - Stack Overflow
Stack Exchange
source
share