skc wrote:I want to display sub-folder's content using PHP. Please help me.
Hmm... Something like this?
<?php
$Directory = '../'; # Start Directory.
if ($Handle = @opendir($Directory))
{ # Does the directory exist?
$Folders = array(); # Define Folders array for future use.
$Files = array(); # Define Files array for future use.
while (false !== ($File = readdir($Handle)))
{ # Lets loop through the files and folders.
if (is_dir($Directory . $File))
{ # Is it a directory?
$Folders[] = $File; # Yes, put it in the Folders array we created earlier.
}
else
{
$Files[] = $File; # Yes, put it in the Files array we created earlier.
}
}
closedir($Handle); # No longer need the directoy so, close it.
}
?>
That should load the $Folders array with a list of folders in any given folder :-)
Cheers,
Ryan Jones