using a txt file to produce a 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
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

using a txt file to produce a table

Post by andylyon87 »

If I have a list of names in a txt file:
Andy
Phil
Dave
andy
How do I go about putting these in a table. Of four columns wide. Also if more were added they would automatically go to the nex line.

E.g.

we have:
Andy
Phil
Dave
andy
from the txt file in a table and i add
Jamie
Jen
Dan
Rach
They would then go beneath, the first four in the table

Have been sat here for hours playin round with the code of a for loop but i can't get it to work.

btw. the above is just an exapmple the real thing is for a gallery with hyperlinked images....thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read "Multi-column formatted output" in the Useful Posts thread (link in my signature)
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post by andylyon87 »

I dont understand SQL very well and am going to be learning the basics in the next few months, however that way makes more sense.

Is there any way of reading the images straight from the file and just opening them on the page using php.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

..that's how you'd display themm.. so yeah.
Post Reply