ifusion Posted May 1, 2008 Share Posted May 1, 2008 Hi there, I'm wanting to post information from a textarea, then if the user has added a break or paragraph in that info then have it display the same as how they wrote it in the form. For example: If the user writes this. Hi there, This is a test and im wanting to see what happens. Thanks for looking! Theres 2 spaces. If i echo that out with the code below it would echo out as one whole paragraph. Heres my code: <html> <head></head> <body> <form action="send.php" method="post"> <textarea name="info" rows="8" cols="40"></textarea><br> </form> </body> </html> PHP: <?php $info = $_POST['info']; echo $info; ?> Link to comment https://forums.phpfreaks.com/topic/103679-solved-how-to-add-paragraphs-when-display-data-in-php/ Share on other sites More sharing options...
AndyB Posted May 1, 2008 Share Posted May 1, 2008 http://ca.php.net/manual/en/function.nl2br.php Link to comment https://forums.phpfreaks.com/topic/103679-solved-how-to-add-paragraphs-when-display-data-in-php/#findComment-530858 Share on other sites More sharing options...
ifusion Posted May 1, 2008 Author Share Posted May 1, 2008 Beautiful. Cheers m8! Link to comment https://forums.phpfreaks.com/topic/103679-solved-how-to-add-paragraphs-when-display-data-in-php/#findComment-530861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.