references:joomla.framework:filesystem:jfolder-filesfiles
Utility function to read the files in a folder. This function uses FTP if enabled, otherwise, it will use the built in PHP functions. An array containing the files in the folder is returned. Syntaxarray files ( $path, $filter, $recurse, $fullpath, $exclude )
ExamplesExample 1Basic example: Example 1 jimport( 'joomla.filesystem.folder' ); $files = JFolder::files( 'templates' ); print_r( $files ); might produce: Result Array ( [0] => index.html ) Example 2Display only PHP files in all sub folders, showing full paths: Example 2 jimport( 'joomla.filesystem.folder' ); $files = JFolder::files( 'templates', 'php$', true, true ); print_r( $files ); might produce: Result Array ( [1] => templates\_system\error.php [2] => templates\_system\offline.php [0] => templates\rhuk_milkyway\index.php ) Discussion |


