Jump to content

carriage return issue


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
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)
     $line = str_replace("\r\n", '<br>', $line);
     $news .= $line.'<br>';

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.

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.