Don't strip spaces

Alright so I have a news system which when it enters a post in the database it uses “addslashes” and all that good stuff and when it’s displayed it uses “nl2br()” and all of that is well and good, comes out clean, spaced. However spacing that is entered does not work. For example if you had a list like this

Category

[ul]- Bullet 1

  • Bullet 2
  • Bullet 3[/ul]

EDIT: My bad it does it in this forum too…the bullets should have two spaces in front of the dash
ADMIN EDIT: Used the LIST tags to “Add Space” so that it DOESN’T do it in this forum too

it comes out like this

Category - Bullet 1 - Bullet 2 - Bullet 3

Anyone have any suggestions on how to make it not skip spacing?

html cares NOT about spaces beyond the first white space.
10 spaces, tab, or one space will all be seen as a single space.
Even Carriage Returns are seen as a single space.

So if you have text that you need formated beyond a single spaces (and wrapped text) you need to use the HTML tools that do this.


- Line Break

- Paragraph Marks
  - Non-Breaking Space (multiples will NOT break or wrap to a new line in the middle)
- Unordered List (this is probably what you need)
- ORDERED list (You might be able to use this one too)
  • - List Item (used with

      and
      )

      You can also make use of TABLEs and DIVs to get the effects you desire, but it doesn’t appear that your issue is with PHP rather it’s with HTML

    Sponsor our Newsletter | Privacy Policy | Terms of Service