Input string from text area
line1
line2 ‘
”line3″
<div>line4<div>
Wanted in database
line<br />1line2 '<br />"line3"<br /><div>line4<div>
I'm using this but it has some error. Nothing inserted to database from example i gave, when an input has a quotes.
$input = $_POST['textarea'];
$input = trim($input);
$input = htmlspecialchars($input);
$input = nl2br($input);
$input = mysql_real_escape_string($input);