Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

makefilelist

This function will create an array of files or folders, depending on the $type, inside the given $folder whit the limit of the $filter.
The sorting of the list is given in the $sort.

makefilelist

Quote

makefilelist ( string $folder, string $filter [, string $sort [, string $type ] ] )


Parameters
folder
The path and the folder where you want to make a list of

filter
Use this to filter out unwanted files or folder, separate names with |

sort
If this is set to true the array will be sorted, default is true

type
You can list up either files or folders, default is files

ext_filter
Filter out extensions by adding them to $extfilter as; $ext_filter = "gif|jpg";

Return Values
This function will return an array with all the files or folders inside a given folder

Example
makefilelist() image folder
Code
<?php
$folder = IMAGES;
$filter = "avatars|news";
$sort = ture;
$type = "folders"
 
makefilelist($folder, $filter, $sort=true, $type="files");
?>

In this example we will list up all the folders inside the IMAGES folder except from the avatars and news folder

Output to Example

Quote

array(
0 => articles,
1 => news_cats,
2 => photoalbum,
3 => ranks,
4 => smiley
}


Changelog
7.01.00 - Added extension filer to filter as a parameter to the function so certain extensions can be filtered out.


See also …


References