ASP guts needs help.
| From: | LW Ellis | Date: | Wed, 22 Sep 2004 06:09:01 +0000 |
| Subject: | ASP guts needs help. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-197515@lists.php.net to get a copy of this message | ||
I'm new to php, but am familar with ASP.
I have this code to open and read a text file.
What I need is to take out the 'while' and present the data one line at a time.
I read up on fgetcsv, but we will be using one text file per record.
I just need to format how it is displayed.
Under fgetcvs there was some code to display records $data[0] and 1,2,3,4,etc.
Can someone please point me in the right direction?
<?php
if (!($fp = fopen("test.txt", "r")))
exit("Unable to open the input file.");
while (!feof($fp))
{
$buffer = fgets($fp, 1024);
print "$buffer<br>\n";
}
fclose($fp);
?>
Thanx in advance.
Later,
Leon