0) { foreach ($default_dir as $dir_key => $startingdir) { if ($dir = @opendir($startingdir)) { while (($file = readdir($dir)) !== false) { if (($file != '.') && ($file != '..')) { $real_path_name = realpath($startingdir.'/'.$file); if (is_dir($real_path_name)) { if (!in_array($real_path_name, $matching_folder_file_names) && !in_array($real_path_name, $default_dir)) { $default_dir[] = $real_path_name; if ($folder_to_find == $file) { $dir_list[] = $real_path_name; } } } } } closedir($dir); } $matching_folder_file_names[] = $startingdir; unset($default_dir[$dir_key]); } } $dir_list = array_unique($dir_list); sort($dir_list); foreach ($dir_list as $dirname) { echo $dirname."
"; } } ?>
Welcome to Beginning PHP5 Chapter 07 Exercise 01

Please enter the folder to search for:

Folder Name