Page 1 of 1

Reading Text files to create html table

Posted: Wed Sep 03, 2003 9:39 am
by mpsdude
Hi folks,
I wonder if someone can help me here.
I have been asked to create web page(s) to display a list of items read from a text file.
The issue is that all my experience has been with NT servers /SQL / MySQL, and this site is hosted on an apache server with no database, but it will accept PHP code (if that makes sense), so it makes sense to use a text file and create an HTML table from it to display.
Although I am a seasoned VB programmer, PHP is very new to me, what is available to manipulate text files - if anything?
On NT servers I use the FileSystemObject to carry out text file manipulation etc.., but FSO does not appear to be available on this particular web server.
I am not asking for a complete solution here, but if someone can point me to the relevant sources to get some example code for reading text files using PHP it would be much appreciated.

Thanks a lot

Posted: Wed Sep 03, 2003 9:47 am
by twigletmac
Best place to start is the manual, specifically looking at the following:
http://www.php.net/manual/en/ref.filesystem.php
http://www.php.net/manual/en/function.file.php
http://www.php.net/manual/en/function.explode.php
to start off with working with text files.

Have a look at tutorial sites like http://www.devshed.com and see what text file manipulation information they have there.

Mac

Posted: Wed Sep 03, 2003 10:05 am
by mpsdude
Thanks Jason

That site was a great help.