Jump to content

[SOLVED] Carriage return issue


SharkBait

Recommended Posts

Hi,

 

I am trying to write information to a file which will be then used to be imported into Excel. I noticed that some of the values that I am retrieving from a database have some sort of carriage return in them so after I have dumped the results to a database with a delimiter, some of the fields break the import because excel thinks its a new line.

 

I've tried to replace chr(13) chr(10), \r\n, \n etc and I am not sure which one it is.  The data that goes into the database is from simple textarea in an HTML form where the user can type whatever they want into it and use the enter key for w newline.

 

Since nl2br() works with the database fields, I am assuming it reads the chr() value but which one is it I should be looking at to replace? Chr(10), Chr(13) combination of the two?  The database/website is on a Linux machine if that helps.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.