User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » php help - traversind a directory Page [1]  
lafta
All American
14880 Posts
user info
edit post

ok i have this code that now opens a directory with MP3's in it, traverses the directory and adds the filenames to an array or something,

i'd like to adjust it so i can put MP3's of different albums in different folders and i want the code to traverse the different folders and get the files just as before,

here is the current code, the part that opens and goes through the files

$dir = PATH . "/" . MP3_PATH;
// Read directory
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$full_name = "$dir/$file";
if (is_file($full_name)) {
$files[$full_name] = $file;
}
elseif ($file[0] != '.') {
$dirs[$full_name] = $file;
}
}
closedir($dh);
}
}

12/12/2007 2:18:51 PM

BigMan157
no u
103352 Posts
user info
edit post

http://www.the-art-of-web.com/php/dirlist/

[Edited on December 12, 2007 at 2:33 PM. Reason : i don't know what you want, look up mkdir() and copy()]

12/12/2007 2:24:23 PM

philihp
All American
8349 Posts
user info
edit post

what is your question?

12/12/2007 2:37:25 PM

lafta
All American
14880 Posts
user info
edit post

the current code opens $dir then goes through all the mp3's in the folder to make a list of files

i want to have subfolders with mp3s in it, then the code go through the different folders and make the same list, thats all

12/12/2007 2:40:39 PM

DirtyGreek
All American
29309 Posts
user info
edit post

http://forums.thewickedflea.com/showthread.php?tid=26

the guy has a big ron paul banner as his signature, though... so i dunno if he's trustworthy

[Edited on December 12, 2007 at 2:51 PM. Reason : .]

12/12/2007 2:43:03 PM

lafta
All American
14880 Posts
user info
edit post

yeah that makes sense, i can do it in c or java, but im not too good with php

12/12/2007 2:49:58 PM

BigMan157
no u
103352 Posts
user info
edit post

look at part 2 of that link i posted

12/12/2007 2:51:17 PM

YOMAMA
Suspended
6218 Posts
user info
edit post

I used this before to the same thing.

http://www.bitfolge.de/snif-en.html

12/12/2007 2:55:31 PM

 Message Boards » Tech Talk » php help - traversind a directory Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.