PHP 8.5.0 Alpha 4 available for testing

Voting

: min(seven, three)?
(Example: nine)

The Note You're Voting On

hotrungdungit at gmail dot com
16 years ago
Below will return an array of file names and folders in directory

<?php
function ReadFolderDirectory($dir = "root_dir/here")
{
$listDir = array();
if(
$handler = opendir($dir)) {
while ((
$sub = readdir($handler)) !== FALSE) {
if (
$sub != "." && $sub != ".." && $sub != "Thumb.db") {
if(
is_file($dir."/".$sub)) {
$listDir[] = $sub;
}elseif(
is_dir($dir."/".$sub)){
$listDir[$sub] = $this->ReadFolderDirectory($dir."/".$sub);
}
}
}
closedir($handler);
}
return
$listDir;
}
?>

<< Back to user notes page

To Top