Shinyshell Community Forums > Coding > nl2br -- FusionNews |
||||||
Sign Up | Member List | New Posts | Help |
[1]
August 08 02009, 19:21 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
I really don't like XHTML. I prefer HTML Strict. So what I wish to do is change my FusionNews installation from <br /> to <br>. I don't know how. Can I just just str_replace()?
|
August 09 02009, 07:42 GMT | ||||
Nick^ merciful justice Location: Brisbane, Australia Post count: 78 |
Why does it matter?
As far I'm concerned, there is little difference in function. Besides, <br /> is closing the <br> tag you opened, which is following the rules of HTML. Plus, it looks better. ______________________________ Lazurane |
August 09 02009, 20:49 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Indeed, I don't know why you'd care so much. Besides, XHTML is a lot neater-looking, but...
nl2br() has been printing XHTML-compatible strings since early PHP 4. It has two parameters. The first is the text to process, and the second is a boolean value that determines whether to use <br /> or <br>. True is the default value, which prints "<br />". Call nl2br as <?php to make it non-XHTML. Assuming you can't find where it does nl2br(), your idea would probably work. Unfortunately, I don't know anything about the code organisation of FusionNews, so I can't tell you where to put the str_replace(). You'll need to find out where it prints the page out. |
August 10 02009, 01:02 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
Oh I see.
Well there's no point in using XHTML if I'm not going to take advantage of its potential. |
August 10 02009, 01:22 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Rubbish, I don't know where the sudden influx of people switching to HTML is coming from because they don't "take advantage of XHTML's potential", but rest assured there are several benefits to using XHTML, including closing every tag, which makes the data contained therein easier to extract and work with.
HTML is a description of the structure of a web page, XHTML is better-formed HTML. It's a sharpened, more modern, more sophisticated version of HTML. HTML seems to promote the practice of leaving tags open, it seems to tempt the coder into creating messy, hacky code. XHTML on the other hand promotes tidiness. That alone is reason enough for me to use XHTML over HTML. |
August 10 02009, 16:24 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
...
*switches to xhtml* |
[1]
Forum Information |
||||||||||
|