Jump to content


Optaining different bits of info from a .txt file


1 reply to this topic

#1 IcroNa

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 23 March 2006 - 02:11 AM

Hey guys, I'm wondering how I could make a php script that does reads a txt file, gets a link, gets a description, and displays this in a table. At the same time I would like it to do this for the entire directory, for every txt file.

I was thinking of having the txt file something like this:

 [Name] Example File [/Name]
[Direct Link] http://www.ursite.com/downloads/file.ext [/Direct Link] 
[Description] An example file download thingamajigy [/Description]

and it would display it like so:

Quote

Example File
An example file download thingamajigy

If anyone could help me with this, I would be incredibly grateful :P

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 23 March 2006 - 05:39 PM

You can either use an xml structure and php's xml functions. Or use the bb-style like you have it, and use preg_match.

As for running it on every file in a directory, you can use the directory functions.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users