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
https://forums.phpfreaks.com/topic/81765-reading-paragraph-returns-from-form-text/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.