![]() |
Happy Holidays Everyone! now to my question : ) limiting results from read dir
ok I learned how to read dir, and list the results.. now my issue is can i limit the results from the directory to only the 3 most recent files in that directory? lets say that the files are images, and I would only like to see the latest three images in that directory. no more. how would i achieve this?
Code:
<? |
Use the filetime function to get the unix timestamp of each file and the sort function to sort them.
ps. To get the extension for all files (including things like file.inc.ext), use sizeof(array)-1 to get the last chunk. |
| All times are GMT. The time now is 05:42 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0