Home > Backend Development > PHP Problem > What does php n mean?

What does php n mean?

藏色散人
Release: 2023-03-14 16:00:02
Original
3459 people have browsed it

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.

What does php n mean?

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template