Home  >  Article  >  Backend Development  >  30-day PHP learning record (line break)

30-day PHP learning record (line break)

烟雨青岚
烟雨青岚forward
2020-07-16 11:46:052511browse

30-day PHP learning record (line break)

PHP newline character

I originally thought that using double quotes could escape \n or 0c6dc11e160d3b678d68754cc175188aPerform a newline operation and find

\nUsage

The following code

Online editing The output result of the processor shows

nocs
you

The output result of the webpage shows

nocs you

It can be seen that the webpage display does not have a line break effect, it is only displayed as a space
Conclusion:\nLine breaks are only applicable to command line execution

##0c6dc11e160d3b678d68754cc175188aUsage

The following code

";    echo "you";?>

Online editor Display results


nocs
you

Web page display results

nocs
you

You can find that the web page display0c6dc11e160d3b678d68754cc175188aachieves the line wrapping effect

Conclusion 0c6dc11e160d3b678d68754cc175188a Web page display line breaks can be realized

Notes

Found a phenomenon when using double quotes to escape the \n character. The web page display does not realize line wrapping, but when viewing the web page source code, the line wrapping effect is achieved

When using double quotes to escape 0c6dc11e160d3b678d68754cc175188a, although the web page displays a line wrapping result, when viewing the web page source code label 0c6dc11e160d3b678d68754cc175188a is still displayed Come out
This means that the result of viewing the source code of the web page is consistent with the result displayed by compiling PHP from the command line

Thank you for reading, I hope you will benefit a lot.

Recommended tutorial: "

php tutorial"

The above is the detailed content of 30-day PHP learning record (line break). 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