Page 1 of 1

what is the best way to get files form a directory?

Posted: Tue Feb 22, 2005 6:38 pm
by jalbey
Ok here is what I am doing; I am taking an array of file types (i.e. extensions, .cs, .txt, .doc etc) then searching for those files in a declared directory. I want to find those file types in the directory then display them in HTML. My question is what is the best way to accomplish this.

Sorry if this has already been posted somewhere before.

Thanks,
CJ

Posted: Tue Feb 22, 2005 7:03 pm
by feyd
opendir()/readdir() or glob()

glob() requires php 4.3.0 or newer..


If you search the forum for those function names, you should come up with a list of many many threads about this.