Results 1 to 3 of 3

Thread: [RESOLVED] Great for \n nl2br but what about keeping indents?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    119

    Resolved [RESOLVED] Great for \n nl2br but what about keeping indents?

    Hello I'm a little lost on this, I'm displaying the output of a tutorials system and am use htmlentities() and nl2br however when users post information like the body of the tutorial and say it has a piece of code like:

    Code:
    If blah = blah
         Look here, this is indented
    end if
    but the output makes it appear flat like

    Code:
    If blah = blah
    Look here, I'm FLAT
    end if
    how can I keep any spaces before the start of a string for each line, how can I retrieve that indent????
    Last edited by Shadows; Dec 21st, 2005 at 11:28 PM.

  2. #2
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: Great for \n nl2br but what about keeping indents?

    \t is used for tab. In one script I used, I just striped out the \n and replaced it with <br>, you can do the same with this, replace \t with 5 nbsp;.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    119

    Re: Great for \n nl2br but what about keeping indents?

    works perfectly now, thanks dude

Posting Permissions

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



Click Here to Expand Forum to Full Width