/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function dirList ($directory) { // create an array to hold directory list // create a handler for the directory // keep going until all files in directory have been read // if $file isn't this directory or its parent, // add it to the results array if ($file != '.' && $file != '..') $results[] = $file; } // tidy up: close the handler // done! return $results; }
Comments
