Use of odd break tag

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sunlion
Forum Newbie
Posts: 2
Joined: Thu Jul 29, 2004 5:25 am

Use of odd break tag

Post by sunlion »

I've RTFM'd, and spent hours googling this in various ways and just can't turn up any explanation of it...

What is the difference between these:

Code: Select all

echo ("A normal br tag ends this line.<br>");
and

Code: Select all

echo ("The weird br space slash ends this line.<br />");
It's that second usage that I don't understand... and it seems to do the same thing, so why the space and the slash? If there's something explaining this ANYWHERE, I apologize, but it seems that it's something you're expected to know even before saying Hello World.
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

Its to do with tightening up the HTML conventions.

As <br> never used to have a closing tag, the <br/> sort of denotes its opened and closed in one go. Its the same with input fields and stuff that doesn't have a matching closing pair.

Thats the way i understand it anyway... :?
sunlion
Forum Newbie
Posts: 2
Joined: Thu Jul 29, 2004 5:25 am

Post by sunlion »

Thanks so much! I can't even begin to tell you how frustrating it was to finally find something totally undocumented anywhere (so it seems). Thanks again. I'm not a programmer, doubt I ever will be, but I did want to learn a few basics of PHP. This searching pretty much used up a whole day's study, but I'd have been back at it tomorrow...
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Also, try googling xHTML. That's where it was introduced. It's just "better" coding practices.
Post Reply