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. Link to comment https://forums.phpfreaks.com/topic/47034-difference-between-and-n/ 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. Link to comment https://forums.phpfreaks.com/topic/47034-difference-between-and-n/#findComment-229435 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 Link to comment https://forums.phpfreaks.com/topic/47034-difference-between-and-n/#findComment-229439 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. Link to comment https://forums.phpfreaks.com/topic/47034-difference-between-and-n/#findComment-229440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.