code.youlikeshare.com
This sample code show you how to read the folders and files inside a directory.

<?php

// Scan the folders and files inside the directory
$folder_name = "c:\your_folder";
$folders = scandir($folder_name);

foreach($folders as $folder){
	if (is_dir($folder_name . $folder)){
		//This is a folder
		echo "Folder: " . $folder . "<br/>";
	}
	else{
		//This is a file
		echo "File: " . $folder . "<br/>";
	}
}
?>