getting all filenames from a location

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
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

getting all filenames from a location

Post by Coco »

The script im using atm automatically creates a counter file in a folder, but doesnt remove them after the system is finished with them. I know how to remove them when they need to go, but obviously before then i need to do some garbage collecting.

So... Is it possible to load every filename from a folder into an array? basically i need to go thru the whole folder, check the file is current to the db, and remove it if it isnt.


Answers as always, gratfully recieved :)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Hi,

Never noticed you were from leeds before :) i am from leeds but live ion York now.

Anyway, to answer your question, have a look at the directory function in the manual, especially this function http://se.php.net/manual/en/function.readdir.php

Mark
Post Reply