Posted by deko on 03/17/07 13:17
>> Is there a way to preserve line breaks and other formatting when coping to a
>> file from a HTML textarea?
>
> Use the nl2br() function when printing out that
> information. (http://www.php.net/nl2br )
>
> To remove the \ signs there is a function called strip_slashes().
Thanks for the tip. This seems to do the trick:
$feedback = trim($_POST['feedback_textarea']);
$feedback = nl2br($feedback);
$feedback = stripslashes($feedback);
That was easy :)
Navigation:
[Reply to this message]
|