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);?> Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.