" in php is: "\n" causes the source code to wrap, but the content displayed by the browser does not; "
" causes the browser to display the content Line breaks, while the source code does not."/> " in php-PHP Tutorial-php.cn"> " in php is: "\n" causes the source code to wrap, but the content displayed by the browser does not; "
" causes the browser to display the content Line breaks, while the source code does not.">

Home>Article>Backend Development> The difference between the characters "\n" and "
" in php

The difference between the characters "\n" and "
" in php

王林
王林 forward
2019-11-20 17:59:31 4303browse

The difference between the characters" in php" >

When writing PHP script code, we often see the two characters \n and
. They both have the function of breaking lines, so what exactly do they mean? What's the difference?

1.\n is to make the source code wrap, but the content displayed by the browser is not;

2.
is to make The content displayed by the browser wraps, but the source code does not.

Example:

PHP code 1:

Browser display:

The difference between the characters \n and <br /> in php

##No newline

View source code:

The difference between the characters \n and <br /> in php

With line breaks


PHP code 2:

"; echo 1; ?>

Browser display:


The difference between the characters \n and <br /> in php

With line breaks

View source code:

The difference between the characters \n and <br /> in php

Without line breaks

This is the difference between the two.

Recommended tutorial:

php tutorial

The above is the detailed content of The difference between the characters "\n" and "
" in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete