Here is a photo clip, I think it's pretty clear.
This is driving me crazy. I can't seem to get php to print a newline either on my localhost(using xampp) or on an online PHP interpreter.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
if you want to use HTML tag inside php, try this:
echo "dkljaks aalksja klajklsa<br/>";
echo "abc jjka kajkajs<br/>";
and see here for br tag and if you don't want to use HTML tag. try this: nl2br() php function for line break.
回答2:
Use this:
<?php echo nl2br("This spans\r\nMultiple lines The new lines will be \r\noutput as well.",false); ?>
回答3:
Try \r\n
instead of \n. Or you can also try <br>
too.
\n will display a new line if you check the HTML source code in your browser.
Also http://www.go4expert.com/forums/showthread.php?t=8021 might help you understand a bit more.
回答4:
You can use <br>
for new line in html. new line is used in case of console
output window.
You can see the references at w3schools paragraph