• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1100
  • 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.
0
noisecouk
Asked:
noisecouk
1 Solution
 
hernst42Commented:
use nl2br function of php when outputting such data. See http://www.php.net/nl2br
0
 
Aamir SaeedCommented:
nl2br()
0
 
noisecoukAuthor Commented:
It works!! Cheers hernst42.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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