Reading Text files to create html table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mpsdude
Forum Newbie
Posts: 2
Joined: Wed Sep 03, 2003 9:39 am
Location: Sussex, UK

Reading Text files to create html table

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
mpsdude
Forum Newbie
Posts: 2
Joined: Wed Sep 03, 2003 9:39 am
Location: Sussex, UK

Post by mpsdude »

Thanks Jason

That site was a great help.
Post Reply