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

Posted on 2007-08-09
Last Modified: 2013-12-12
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.
Question by:noisecouk
    LVL 48

    Accepted Solution

    use nl2br function of php when outputting such data. See
    LVL 14

    Expert Comment

    by:Aamir Saeed

    Author Comment

    It works!! Cheers hernst42.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now