How to display line breaks in txt file with php include?
Posted: Fri Sep 17, 2010 10:10 am
A little background, I'm making a site for a friend who sends out a daily newsletter. I'm using a simple cgi newsletter script, which I've rigged to create a "dailynews.txt" text file whenever he sends a newsletter out. On the newsletter subscription page I'd like to show the contents of the "dailynews.txt" file. This is an easy way for him to update this page daily without ever having to use ftp/html/php/etc. which he knows nothing about.
I'm using to display the text file on the page, which works fine EXCEPT line breaks aren't displaying.
ie. a 3 paragraph message is sent, the created text file when opened shows 3 paragraphs, but on the subscription page when I'm trying to display it, the lines all flow together with no paragraph breaks.
How do I include a text file in a page so the line breaks are displayed?
Thanks so much for your help,
Diane
I'm using
Code: Select all
<?php include($_SERVER['DOCUMENT_ROOT'].'/mynewsfolder/dailynews.txt'); ?> ie. a 3 paragraph message is sent, the created text file when opened shows 3 paragraphs, but on the subscription page when I'm trying to display it, the lines all flow together with no paragraph breaks.
How do I include a text file in a page so the line breaks are displayed?
Thanks so much for your help,
Diane