0

i'm currently learning php. i'm making a file for a friend instead of using the page that comes up when theres no index file in a folder.

i want the directories to come up first and then the files.

heres the essence of the code:

//$entry is the filename

while($entry = $dir->read()) { 
    if(($entry == ".") || ($entry == "..")) { 
        continue; 
    } 
if (!strpos($entry, ".")){ 
    //then it is a directory 
}else{ 
    //then file 
} 
echo "<BR>"; 
&#125;

you can see the output here: http://www.smuserver.net/c79studios

3
Contributors
3
Replies
7
Views
14 Years
Discussion Span
Last Post by imgtube
0

Are you just posting that for us to look at, or do you need help with it?

I just didn't see a question.... lol

0

i want the directories to come up first and then the files.

how would i do this?


(you can see the output here if that helps)

0

im not sure about that, maybe you could just start again from scratch and check everything as you go.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.