rbvinc Posted October 4, 2010 Share Posted October 4, 2010 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, Quote Link to comment https://forums.phpfreaks.com/topic/215125-display-latest-files-as-urls/ Share on other sites More sharing options...
kai555 Posted October 26, 2010 Share Posted October 26, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/215125-display-latest-files-as-urls/#findComment-1126607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.