In a lot of PHP tutorials, I have seen that the use of carriage return.
"/n" and "/r"
But Im very curious why we cannot just use echo "<br>"
tag?
In a lot of PHP tutorials, I have seen that the use of carriage return.
"/n" and "/r"
But Im very curious why we cannot just use echo "<br>"
tag?
<br>
is a new line in on a HTML page (an will display as such for the view on any web page). \n and \r are used more for the 'formatting' of the HTML code itself and will show on a single line for the viewer.
In a text area, however, \n or \r will show as a new line, whereas a <br>
would not. \n or \r could also be used within strings for scripts that don't allow carriage returns such as javascript.
is a html tag that when rendered on a webpage it starts a new line. – Clint Aug 04 '18 at 12:38