blacknight Posted December 1, 2007 Share Posted December 1, 2007 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 More sharing options...
MadTechie Posted December 1, 2007 Share Posted December 1, 2007 htmlentities(mysql_real_escape_string(nl2br())) Link to comment https://forums.phpfreaks.com/topic/79694-carriage-return-issue/#findComment-403574 Share on other sites More sharing options...
blacknight Posted December 1, 2007 Author Share Posted December 1, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.