/ Question & Réponse / List all the files and folders in a Directory with PHP recursive function List all the files and folders in a Directory with PHP recursive function PHP Développement back-end function getDirContents($dir, &$results = array()) { $files = scandir($dir); foreach ($files as $key => $value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (!is_dir($path)) { $results[] = $path; } else if ($value != "." && $value != "..") { getDirContents($path, $results); $results[] = $path; } } return $results; } var_dump(getDirContents('/xampp/htdocs/WORK')); Question & Réponse How can I add a attribute to a DOM element in JavaScript ? Javascript Développement front-end How to sort an array of integers correctly JavaScript ? Javascript Développement front-end How to create a directory using NodeJS ? Node.js Développement back-end How to display all files in a directory using Node.js ? Node.js Développement back-end How to scroll top position in page HTML with Jquery Jquery Développement front-end How to force page scroll position to top at page refresh in HTML Javascript, Jquery Développement front-end How to get random value out of an array ? PHP Développement back-end How to reload or refresh an iframe ? Javascript Développement front-end How to reload or refresh an iframe ? Javascript Développement front-end How to style the input type time CSS Intégration web How to Copy Text with javascript Javascript Développement front-end How Minify CSS with PHP PHP Développement back-end