Created
August 27, 2011 05:28
-
-
Save andredublin/1175024 to your computer and use it in GitHub Desktop.
Scans files and adds all files to an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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