Home >Backend Development >PHP Tutorial >30-day PHP learning record (line break)
I originally thought that using double quotes could escape \n or 0c6dc11e160d3b678d68754cc175188aPerform a newline operation and find
The following code
<?php echo "nocs\n"; echo "you";?>
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
<?php echo "nocs<br>"; echo "you";?>Online editor Display results
nocs<br>youWeb page display results
nocs you
You can find that the web page display0c6dc11e160d3b678d68754cc175188aachieves the line wrapping effectConclusion 0c6dc11e160d3b678d68754cc175188a Web page display line breaks can be realized
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 achievedThank you for reading, I hope you will benefit a lot. Recommended tutorial: "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
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!