get_filenames()

get_filenames($source_dir[, $include_path = FALSE])

Parameters:
  • $source_dir (string) – Directory path
  • $include_path (bool) – Whether to include the path as part of the filenames
Returns:

An array of file names

Return type:

array

Takes a server path as input and returns an array containing the names of all files contained within it. The file path can optionally be added to the file names by setting the second parameter to TRUE.

Example:

$controllers = get_filenames(APPPATH.'controllers/');
doc_CodeIgniter
2016-10-15 16:32:23
Comments
Leave a Comment

Please login to continue.