View Single Post
  #1 (permalink)  
Old 07-24-2008, 11:45 AM
punkrazio punkrazio is offline
WebProWorld New Member
 
Join Date: May 2008
Posts: 11
punkrazio RepRank 0
Default order file by last mod

Hi all
i've got a directory where php creates a txt file every time someone update his stock.

i create file txt like this:

customer-last-update-stock-05-06-2008---10-29-42.txt

i read the files in the directory with this script:

PHP Code:
if ($handle opendir('/web/htdocs/directory/home/customer/update_stock/')) {
    while (
false !== ($file readdir($handle))) { 
        if (
$file != "." && $file != "..") { 
            echo 
"<a href=\"../customer/update_stock/$file\" target=\"_blank\">$file</a><br>\n"
        } 
    }
    
closedir($handle); 

now my question is..

how can i order and print the files by last mod time??
there is any way?

hope you can help

bye bye
Reply With Quote