PHP: How do I display the contents of a textfile on my page?

前端 未结 8 731
囚心锁ツ
囚心锁ツ 2020-12-16 09:37

I have a .txt file on my web server (locally) and wish to display the contents within a page (stored on the same server) via PHP echo.

The .txt file contains a numbe

8条回答
  •  有刺的猬
    2020-12-16 10:14

    I had to use nl2br to display the carriage returns correctly and it worked for me:

    
    

提交回复
热议问题