Jump to content

Display latest files as urls


rbvinc

Recommended Posts

I have list of files in a folder, I update these files periodically. I want to display only latest files or today's (date=today) with URL link to that new files with that file name as url link.

 

example..

<a href="/newfiles_10042010/newfile_10042010.php">newfile_10042010</a>

 

Please publish sample code or tutorial links.

 

Thank you,

 

Link to comment
https://forums.phpfreaks.com/topic/215125-display-latest-files-as-urls/
Share on other sites

  • 3 weeks later...

Hi

 

You can use

int filemtime ( string $filename )

to get when a file was last modified. It returns a unix time stamp that you can give to date() to process further.

 

You can use opendir() to open a handle to you directory and then use readdir($handle) to cycle through all files in your folder.

 

Hope this helped. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.