Results 1 to 3 of 3

Thread: Break Lines

  1. #1
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default Break Lines

    So I'm making a page editor (PHP) and obviously people don't wanna put <br /> so I was wondering how I could declare it, I was thinking of using str_replace but what would I replace?

  2. #2
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    http://php.net/manual/en/function.nl2br.php

    nl2br should do the job

    I wouldn't insert it into the database with breaks if you plan on editing it in a textarea later on (as textareas work with nl). So when you echo it, just use that function.
    Last edited by Moh; 08-11-2010 at 10:30 AM.

  3. #3
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    Thanks. You're a legend. +rep

Posting Permissions

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