function to get directory content without '.' and '..' added

This commit is contained in:
steckbrief 2017-11-26 14:38:05 +01:00
parent b713fcfb99
commit f6c7ca5531

View file

@ -16,6 +16,13 @@ function generate_uuid() {
);
}
function getDirectoryContent($path) {
if (dir_exists($path)) {
return array_diff(scandir($path), array('..', '.'));
}
return [];
}
function dir_exists($path) {
return file_exists($path) && is_dir($path);
}