|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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:
how can i order and print the files by last mod time?? there is any way? hope you can help bye bye |
|
|||
|
use 'ls -t' or 'ls -tr'
__________________
Looking for a unique gift? Send one of our gourmet cookie bouquets today. Food lovers - visit the Gourmet Gift of the Day Blog for delicious ideas. |
|
|||
|
its useless put everything so small in a database
anyway i have found the solution for every one who need it: $arrayfile = Array(); function ordina($file1,$file2) { $tempo1 = filectime($file1); $tempo2 = filectime($file2); return ($tempo1 < $tempo2) ? 1 : -1; } if ($handle = opendir('/web/htdocs/domain/home/customer/update_stock/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $arrayfile[]='../customer/update_stock/'.$file; } } closedir($handle); usort($arrayfile,'ordina'); //print_r($arrayfile); foreach($arrayfile as $txt) { echo "<a href=\"$txt\" target=\"_blank\">".str_replace("../customer/update_stock/","",$txt)."</a><br>\n"; } } clearstatcache(); |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File Extension / File Suffix in SEO | Ladana | Search Engine Optimization Forum | 6 | 07-10-2008 06:56 PM |
| html file w/ no file extension | kruser | Web Programming Discussion Forum | 10 | 02-16-2008 01:04 AM |
| How to converter video file into a flash file ,with effect? | andy_lucky | Flash Discussion Forum | 0 | 04-04-2006 12:37 PM |
| Windows 2000 Slow with File Open and File Save Dialog Boxes | steve0 | IT Discussion Forum | 2 | 09-15-2005 06:27 PM |
| Dreamweaver: Error accessing file...bad file path | mimsymc | Graphics & Design Discussion Forum | 6 | 07-10-2005 09:43 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |