0

Could someone help me with this - I've cracked my head since.

When i submit a form and then retrieve the data, there is no paragraphs.

Yes I am aware of HTML encoders like TINYMCE but I'd like to submit in plain text.

I tried htmlentities and htmlspecialchars but nothing works. I just want to see a new paragraph when I've received the data of a submitted form. (a New paragraph after hitting ENTER twice)

Thanx

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by sallecpt
0
$output = "";
$array = explode("\r\n\r\n", $_POST['freetext']);
foreach($array as $paragraph)
	$output .= "<p>$paragraph</p>\n";
echo $output;
0

Even you can use nl2br function during displaying it.

e.g. <td><?php echo nl2br($address);?></td>

0

WOW. WORKS WONDERS. A HUGE THANK YOU TO LethargicCoder, AND ALSO TO rajarajan07 AND TO vibhadevit

Have a great day guys.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.