CSV description line breaks

Hello,

I have a script writing to a csv file and there are line breaks in the file, the client said he wants it all to be in one line. Is there a way to make it so the script makes it on one line but it still has the breaks?

strip_tags(str_replace("\"",""",$row2['description']))

$description = "
The following is a list of options as this 300E is currently
equipped:



    - 3.0L  6-Cyl.

    - 4 Speed
Automatic Transmission

    - 4 Wheel Disc
Brakes";
LVL 1
movieprodwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ricky MartireIT Design ArchitectCommented:
Yes, make the output use '\r\n' on the same line, this will ensure that the CSV outputs all on one line but when its imported at the other end it will put the line breaks back in.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
Since &nbsp; only works in HTML, replace the line breaks with <br> which is an HTML line break.
0
movieprodwAuthor Commented:
yes but how to I str replace them? I do not know what character is making the line break
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Dave BaldwinFixer of ProblemsCommented:
You will have to examine the text.  It could be any combination of CR's and LF's.
0
Ray PaseurCommented:
If you can post a few samples of the data and show us what you want to change it into, I am fairly sure we can help.
0
movieprodwAuthor Commented:
Thanks guys, I just removed all returns and the client was happy.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

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.