Saturday, May 21, 2011

Php Code: Recursive Directory Browser

This function takes in a directory path and recursively searches through the directory structure and returns all files in those directories. The file list is returned in an array.

This function has 1 required parameter and 2 optional parameters.

directoryToArray(Path to Directory [,file extention [,Display Full Path]]

If the file extension parameter is set, only files matching that extension will be displayed, ie, "jpg"

If the Display Full Path parameter is true, then the full path of the file will be returned. If it is false, only the file name will be returned. By default, this parameter is set to true.

No comments:

Post a Comment