The browser cannot recognize n or rn. The two linefeeds are text linefeeds, which are valid in the text file. if you need to output the results to the browser or print them to the monitor, use br in the code; if it is just a line break in the source code, use n or rn. if you are interested, you can understand it. it may be helpful for you to learn php code:
The code is as follows:
Echo 'hello
';
Echo 'World! ';
?>
Output:
Helllo
World!
Code B:
The code is as follows:
Echo 'hello \ n'; // \ n for unix; \ n for windows
Echo 'World! ';
?>
Output:
Helloworld!
Analysis: The browser cannot recognize \ n or \ n. the two line breaks are text line breaks, which are valid in text files. you can check the HTML source code on the webpage and find that code B successfully implements line breaks.
Summary: If you need to output the result to a browser or print it to the monitor, use
; Use or \ n if it is just a line break in the source code