function to get directory content without '.' and '..' added
This commit is contained in:
parent
b713fcfb99
commit
f6c7ca5531
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue