|
-
Dec 21st, 2005, 10:59 PM
#1
Thread Starter
Lively Member
[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.
-
Dec 21st, 2005, 11:19 PM
#2
Fanatic Member
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;.
-
Dec 21st, 2005, 11:28 PM
#3
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|