Computer Science Canada List Files In Directory by Last Modified |
Author: | Numbah51 [ Fri Feb 09, 2007 11:20 pm ] | ||||
Post subject: | List Files In Directory by Last Modified | ||||
I wanna list the files in a directory with the last modified (added) at the top, then the next, etc. Right now my code is: (Right now it lists alphabetically)
Any Help Would Be Greatly Appreciated. EDIT: (I'll leave original message) i found this code:
It doesn't display anything. I can tell the error is in the foreach loop but i cannot seem to fix it EDIT: I think I got it. There was an Extra " |
Author: | wtd [ Sat Feb 10, 2007 9:49 am ] |
Post subject: | RE:List Files In Directory by Last Modified |
Investigate array_multisort. |
Author: | Waffa [ Tue Dec 01, 2009 3:20 am ] | ||
Post subject: | Re: List Files In Directory by Last Modified | ||
I will get error whit the last skript: Parse error: syntax error, unexpected '"', expecting ',' or ';' in /home/v3451/public_html/OSc/muudetud.php on line 39 - do i need to change directory also in your last script or it will list this root directory & subdirectory files where the php file is uploaded? I use my self this script but it does not arrange files by date:
|
Author: | jeffgreco13 [ Tue Dec 01, 2009 12:32 pm ] | ||
Post subject: | Re: List Files In Directory by Last Modified | ||
look into... http://php.net/manual/en/function.filemtime.php .. this returns a UNIX timestamp to be used with the date() function in PHP. http://www.php.net/manual/en/function.date.php i recommend using:
it gives u the amount of seconds of the given timestamp since the UNIX epoch. Therefore highest number = latest modified. You could try and get something going with that. |