madspof Posted September 3, 2006 Share Posted September 3, 2006 i cannot get this script to work <?php function scan_folder($dir) { $handle = opendir($dir); while ($file = readdir($handle)) { if (is_dir("$dir\\$file")) { if (!ereg("^\.+", $file)) { $files .= scan_folder("$dir\\$file"); } } else { if (@eregi($_POST['matches'], $file)) { $files .= "$dir\\$file" . "\n"; } } } closedir($handle); return $files;}// Add the Directory root you want to scan$dir = "C:\stuff4free\newsite\music";// This is how you use the function. Simple!echo scan_folder($dir);?> Link to comment https://forums.phpfreaks.com/topic/19587-can-anyone-see-what-wrong-with-this-script/ Share on other sites More sharing options...
kenrbnsn Posted September 3, 2006 Share Posted September 3, 2006 Please tell us how you're using this. What errors do you get?Ken Link to comment https://forums.phpfreaks.com/topic/19587-can-anyone-see-what-wrong-with-this-script/#findComment-85216 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.