Page 1 of 1

Form Formatting

Posted: Sun Feb 01, 2004 9:51 am
by tecton
how do you have a text box pass its formatting through a form?

as in line breaks and spaces

Posted: Sun Feb 01, 2004 11:11 pm
by jaxn
if you are wanting text entered in a textarea to be displayed on an html page and keep the line breaks, use the nl2br() function on the posted form field.

Code: Select all

<?php
$formatted_text = nl2br($_POST['your_textarea']);
?>