Skip to content

Instantly share code, notes, and snippets.

@andredublin
Created August 27, 2011 05:28
Show Gist options
  • Save andredublin/1175024 to your computer and use it in GitHub Desktop.
Save andredublin/1175024 to your computer and use it in GitHub Desktop.
Scans files and adds all files to an array
/**
* Scans folder and adds all folders to array.
*
* @param string $path folder path
* @return array found folders in array
*/
function get_folders($path) {
$folders = scan_dir($path);
$import = array();
foreach ($folders as $folder) {
if (substr($folder, 0, 1) != ".") {
if (is_dir($path.$folder."/"))
$import[] = $folder;
}
}
return $import;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment