From f6c7ca5531a1de2d8bb5f1c32a112901bd1a491e Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sun, 26 Nov 2017 14:38:05 +0100 Subject: function to get directory content without '.' and '..' added --- functions.common.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- cgit v1.2.3