summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-11-26 14:38:05 +0100
committersteckbrief <steckbrief@chefmail.de>2017-11-26 14:38:05 +0100
commitf6c7ca5531a1de2d8bb5f1c32a112901bd1a491e (patch)
tree16176ee73c4d9a4301f34a8229ca9c23c04544b9
parentb713fcfb99dc9c2061fef5e9d0c074aaf8aac4da (diff)
function to get directory content without '.' and '..' added
-rw-r--r--functions.common.inc.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/functions.common.inc.php b/functions.common.inc.php
index 514574e..11bcefc 100644
--- a/functions.common.inc.php
+++ b/functions.common.inc.php
@@ -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);
}