Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting data returned

    All

    I have a field named Address in my database.

    When i return the contents of this field it comes out in one long string. If i put it in a text area it formats it correctly - puts in carriage returns....

    How can I get the same results as the textarea without using a text area? - i.e. just display it ....

    Thanks

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    <?php
    $str = nl2br($str);
    echo $str;
    ?>

    http://www.php.net/nl2br

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cheers

    thats nice and easy!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •