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

Recommended Answers

All 3 Replies

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

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)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.