Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to format text from HTML textarea?
March 17, 2007, 12:56 pm
rate this thread
comments, etc. Nothing special. When users click the "Send" button, the form
posts, and I copy the contents of the textarea to a file like this:
$feedback = trim($_POST['feedback_textarea']);
$fp = fopen($feedback_file,'a');
The problem is the line breaks in the textarea are lost when copied to the file.
This is a line.
This is a new line.
This is another new line.
This is a line. This is a new line. This is another new line.
This is a "test"
This is a \"test\"
Is there a way to preserve line breaks and other formatting when coping to a
file from a HTML textarea?