Jump to content

carriage return issue


blacknight

Recommended Posts

ok i have a website where i post new on it

 

when i send the new to sql i get \r\n carriage return and new line ussie being.. i have tryed avery thing and i mean every thing to remove these explode preg str you name it ive tryed it and i cannot get them out and just replace them with a simple <br> any one have any ideas at all... and i have tryed

 

nl2br(mysql_real_escape_string(htmlentities( no luck ither i ended up with \\r\\n and still cant remove them .....

Link to comment
https://forums.phpfreaks.com/topic/79694-carriage-return-issue/
Share on other sites

i managed to fix it some how Oo this is what i used

 

$text = nl2br(trim($row['text']));
$news = '';		
$lines = explode("\\r\\n", $text);
$i = 0;
     foreach ($lines as $line)
     {
     $i++;
     $line = str_replace("\r\n", '<br>', $line);
     $news .= $line.'<br>';
     
     } 

Link to comment
https://forums.phpfreaks.com/topic/79694-carriage-return-issue/#findComment-403592
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.