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 ..... Quote Link to comment Share on other sites More sharing options...
MadTechie Posted December 1, 2007 Share Posted December 1, 2007 htmlentities(mysql_real_escape_string(nl2br())) Quote Link to comment 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>'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.