doujiao2000 2015-05-03 01:40
浏览 69
已采纳

PHP字符转义序列不起作用

I am an extreme web programming beginner who is just starting to learn PHP with some knowledge of HTML and JavaScript.

I use WAMP Server as my web server and Eclipse PDT as my IDE. I created a .php file in Eclipse. I just want to run a simple code that I pulled from a text book:

<?php
echo "Hello World
apple";
?>

However, the line break does not work and it just makes a space.

How can I solve this?

  • 写回答

1条回答 默认 最新

  • dqo58772 2015-05-03 01:43
    关注

    If you are displaying the code with a browser, you should either change the to be <br> or wrap the string in an nl2br call - like echo nl2br("Hello World apple");

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?