Reemplazando \ r \ n con PHP
Tengo un formulario de publicación, que inserta mi texto en una base de datos MySQL.
Yo suel
$post_text = mysql_real_escape_string(htmlspecialchars($_POST['text']));
y quiere reemplazar el\r\n
que se agregó automáticamente.
Lo intent
$text = str_replace('\\r\\n','', $text);
$text = str_replace('\r\n','', $text);
$text = str_replace('\\R\\N','', $text);
$text = str_replace('\R\N','', $text);
$text = str_replace('/\r\\n','', $text);
$text = str_replace('/r/n','', $text);
$text = str_replace('/\R\\N','', $text);
$text = str_replace('/R/N','', $text);
pero\r\n
siempre se incluye en las entradas de mi base de datos.
¿Cómo puedo arreglar esto