Output Data from Text File with PHP
Written by admin on Wednesday, May 7th, 2008 in PHP Tutorials, General.
In this tutorial I am going to teach you how to generate data from a text file with the use of PHP.
To start you must first make a document called data.txt
Open up your data.txt for editing (I highly recommend using Notepad++).
Now put the following code into your text file.
| News 1 | News 2 | News 3
The above is what we can output. Each phrase is separated by a |. We need this so that we can tell our php script when to stop outputting a piece of data.
Now you need to make a PHP file called quotes.php.
This is the file that will generate our data.
Insert the following code into your php file.