inVINCEable Posted April 14, 2007 Share Posted April 14, 2007 It seems as if when I use <br> alone, I get the same result as when using <br> /n What are the differences between these. Thank you. Quote Link to comment Share on other sites More sharing options...
Voldemort Posted April 14, 2007 Share Posted April 14, 2007 Here's what I'm (almost) sure of... <br> is HTML. <br /> is XHTML (and as such, most recommended). \n is a newline in the code (doesn't get output to the screen). Basically the first one is old HTML, second is new HTML, and third is a way so that you files don't have the code structure of <html><head><title>Title</title></head><body>Hello World</body></html> when looked at it the source code. Quote Link to comment Share on other sites More sharing options...
Barand Posted April 14, 2007 Share Posted April 14, 2007 \n is a newline in the code (doesn't get output to the screen). ... unless you use pre tags <?php $text = "Hello\nWorld"; echo $text; echo '<pre>', $text, '</pre>'; --> Hello World Hello World Quote Link to comment Share on other sites More sharing options...
Voldemort Posted April 14, 2007 Share Posted April 14, 2007 ah yes, and code tags. Pesky little things, those are. I use \n alot when I'm writing lots of lines to a text file or to another php file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.