Sometimes when saving user input from an HTML textarea to a MySQL database and it is later retrieved from the database to be displayed in the front end, it display with line breaks. The problem occurs when users submit text hitting the Enter key at the end of lines. It issue can also arise within a WordPress environment.
How to remove line breaks from a string
You should be able to get rid of those line breaks by replacing them with a preg that removes all newlines and carriage returns. The code is:
$yourNewString = preg_replace( "/\r|\n/", "", $yourString );
Even thought the \n characters are not appearing, if you are getting carriage returns there is an invisible character there. The preg replace should grab and fix those.