Jump to content

Reading paragraph returns from form text


stevenreid

Recommended Posts

I've a facility where a site owner submits text that is saved into a csv from a textarea.

 

When it is read back from the csv I have the problem of any returns being read in as \r\n\r\n

 

I tried a character str_replace and I've read up a bit on the problem but none of the solutions I've found have seemed to work for me.

 

$thisStoryStory =  $thisStory[2];

$thisStoryStoryB = str_replace(array("\r\n\r\n", "\r\n", "\r", "\n"), "<br />",$thisStoryStory);

echo "<p>".$thisStoryStoryB."</p>";

 

was what I used and I thought should have worked fine but I still get

 

audience up for a great time.\r\n\r\nClick the link below to

 

Cheers.

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.