Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have the below code. [code] i

Status
Not open for further replies.

gagz

Programmer
Nov 21, 2002
333
US
I have the below code.

Code:
if ($dir = @opendir("./")) {
  while (($file = readdir($dir)) !== false) {
    #do some stuff
  }  
  closedir($dir);
}

is there a way to sort opendir? Ie if files are named file-01.txt file-02.txt?

I could probaby fill and array then sort that, but don't want to add that step...

Thanks.
 
u can always collect all the files/folders from opendir and run them through a custom sort routine. --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top