Possible Duplicates:
PHP recursive directory path
PHP Get all subdirectories of a given directory
PHP: Get list of all filenames contained within my images directory
I have a directory on the server which contains some sub folders. The sub folders contain some pdf files. I need to display all sub folder names and sub folder data as well. Please guide me how to read data in subfolders.
here is my code
<?php
$number=$_REQUEST['Username'];
$folder=dir("UserIds/".$Username."/");
$i=0;
while($folderEntry=$folder->read())
{
if($folderEntry !=".." && $folderEntry !=".")
{
$message[$i]="http://www.myappdemo.com/appinstaller/UserIds/$number/".$folderEntry;
$i++;
}
}
echo json_encode($message);
$folder->close();
?>
here I am enter the directory name I need that particular directory data will display
please guide me
Thanks for advance...