Output text file with line breaks in PHP

前端 未结 9 1068
一个人的身影
一个人的身影 2020-11-28 14:11

I\'m trying to open a text file and output its contents with the code below. The text file includes line breaks but when I echo the file its unformatted. How do I fix this?<

9条回答
  •  隐瞒了意图╮
    2020-11-28 15:11

    Say you have an index.php file hosted by the web server. You want to insert some multi-line text file contents into it. That's how you do it:

    
            
    Some multi-line message below:

    This part is just a shorthand, which instructs the web server, that it needs to be treated as a PHP echo argument.

提交回复
热议问题