Re: Re-inserting newlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Philip Thompson wrote:
<snip>
That's the thing, I'm not inserting \r\n at all. When filling in the form, I hit "Enter" to go to the next line in the textarea. When I pull the original data I do:

$textarea = mysql_real_escape_string($_POST["textarea"], $connection);

if ($error) {
    // somehow replace the \r\n that mysql_real_escape string put in

    // then strip all the other slashes remaining: \' becomes '
    $textarea = stripslashes($textarea);

    // return to page
}

$textarea = preg_replace ( "/\\\\r\\\\n/", "\n", $textarea )

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux