I'm trying to add a <textarea> to a MySQL database.
The <textarea> has multiple lines, so I want to replace \r\n with <p></p>
Here's the <textarea> formatting script:
It returns, "**line 1**\r\n**another line**"PHP Code:$entry = $_POST['entry'];
$entry = "<p>".$entry."</p>";
$entry = str_replace("\r\n", "<p></p>", $entry);


Reply With Quote

Bookmarks