• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1106
  • Last Modified:

PHP Converting new lines in multiline text box with </br> line break

Using PHP and MySQL, I've got a multiline input box where the admin can add an event location. The multiline text box outputs this to a MySQL database in the format:

Line 1
Line 2
Line 3...

When calling this in the display page in PHP, I want the page to recieve the information from the MySQL database and apply each line with a </br> at the end of each line. Is there a way to do this??

Thanks, Dan.
1 Solution
use nl2br function of php when outputting such data. See http://www.php.net/nl2br
Aamir SaeedCommented:
noisecoukAuthor Commented:
It works!! Cheers hernst42.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now