php n refers to \n, which represents a newline character. Its function is that when echo outputs a string, the content after this symbol will be output on a new line. The \n symbol is based on New Line. Come.
The operating environment of this article: Windows 7 system, PHP version 7.1, Dell G3 computer.
php What does n mean?
In the PHP language, the \n in the string represents a newline. It is the special character with ASCII 10. Its function is that when echo outputs the string, the content after this symbol is in the new Output on one line, \n is based on the New Line.
In addition to \n in PHP, there are also \r that represents carriage return (ASCII is 13), and \t that represents tab (ASCII is 9). These are basically the same as PERL and C languages.
Brief analysis:
is HTML code, \n is ASCII code, the browser parses HTML code, not ASCII code, after using \n, the browser You can't see line breaks, but if you look at the source file of the page, you can see that line breaks appear where there are \n in the code. This is because \n can be seen in text files, but
is HTML. Show line breaks.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What does php n mean?. For more information, please follow other related articles on the PHP Chinese website!