Experts Exchange connects you with the people and services you need so you can get back to work.
The output probably has backslashes like this: \r\n. These are end-of-line ("EOL") characters, roughly termed "carriage return" and "new line." They probably come from a PC file or document, since Unix uses only one EOL, the \n.
You should store them if they are meaningful in the context of the data and if your application needs them. Otherwise you can trim() them off. It is possible to remove them from the interior of a data string, but it's a little more involved, and it's less likely that you would want to make a change in the middle of a data string.
These EOL characters interact with real_escape_string() functions because they contain backslashes that have programmatic meaning (just like escaped apostrophes). The MySQLi engine strips backslashes automatically, with the understanding that it expects to receive escaped data, and store exact representations of the data.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $62.50.
Premium members get this course for $174.99.
Premium members get this course for $349.00.
Premium members get this course for $159.20.
Premium members get this course for $122.40.
Premium members get this course for $18.75.