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
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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.