PHP Classes

list files and folders: list files and folders in a directory

Recommend this page to a friend!
  All requests RSS feed  >  list files and folders  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

list files and folders

Edit

Picture of Agustín Sardón by Agustín Sardón - 9 years ago (2015-04-27)

list files and folders in a directory

This request is clear and relevant.
This request is not clear or is not relevant.

+10

given a directory, list files and folders on that directory

Ask clarification

4 Recommendations

PHP Filesystem Helper Library: Manipulate and search files and directories

This class can manipulate and search files and directories.

It can create directories, read and write, as well and delete files and folders recursively using PHP iterator classes.

The class can also search for files inside given directories recursively using regular expressions to filter the file names.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Joshua McKenzie by Joshua McKenzie package author package author Reputation 75 - 9 years ago (2015-12-07) Comment

Like Ravi's, my class uses Iterators, which process with the loop, so it's cancelable and doesn't take much memory; which makes looping 100000+ files very easy. Regex supported. Hope it helps.


PHP SPL File Find: SPL iterator to find files with different criteria

This package implements SPL iterators to find files with different criteria.

It can take a path a directory to traverse to start finding files.

There are additional iterator classes to sort files by name, sort by type, sort by last access time, sort by last change time, to filter files with a given file name extension, filter only files or only directories, and to limit the number of found files, or limit by directory depth or file size.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Ravi Kumar by Ravi Kumar package author package author Reputation 100 - 9 years ago (2015-08-03) Comment

As Dave said there are plenty to choose, hope this helps.


MySQL Database Library: Access MySQL databases and manipulate files

This class can access MySQL databases and execute common queries. Currently it can:

- Connect to a given MySQL host and access a given database
- List all tables in the accessible databases
- Get the columns of a given table
- Compose and execute SELECT queries to a given table getting specific fields by a given sorting order returning the results into a single array
- Search for given table records that match given conditions
- Insert table records with given field values
- Update table records with given field values and conditions
- Delete table records that match a condition
- Create table records for a new user with a password
- Authenticate a given user with a password in the users table
- Change a given user password in the users table
- Update or delete given user records in the users table
- Read the text contents of files in the format CSV, PDF or Microsoft Word
- Write plain text or CSV files
- Rename or delete files
- Get the list of files from a directory
- Etc..
This recommendation solves the problem.
This recommendation does not solve the problem.

+3

Picture of Justin Eldracher by Justin Eldracher package author package author Reputation 160 - 9 years ago (2015-06-22) Comment

The getfiles() method in my class lists all the files in a given directory, and returns an array of the names. You can filter out which files you want with a regular expression. Sorry, doesn't include directories, though.


Directory and file info: Retrieve information about files and directories

This class can be used to retrieve information about files and directories.

It can:

- Retrieve an array with the list files in a given directory with several details like the file names, file sizes, last access date, last modified date, etc.
- Optionally traverse the given directory recursively to list files contained in sub-directories
- Filter the listing by file name extension, MIME type, last modified and last accessed dates.
- Filter a listing with additional criteria to create a more restricted listing
- Sort the retrieved listing
- Determine the most recently changed file
- Calculate the size of the files in a given directory listing
- Retrieve the size, last modified and last access data, permissions, owner and MIME type of a file in in a human readable format
This recommendation solves the problem.
This recommendation does not solve the problem.

+5

Picture of Dave Smith by Dave Smith Reputation 7620 - 9 years ago (2015-05-03) Comment

There are plenty to choose from, this is the one that I would start with to see if it meets your needs.


Recommend package
: 
: