davefootball123 Posted September 11, 2013 Share Posted September 11, 2013 Hello all, this issue really has me stumped. I'm actually a bit unsure of where to start. There are a bunch of files in a directory shown here. http://dd.weatheroffice.ec.gc.ca/bulletins/alphanumeric/20130911/WU/CWTO/00/ What I need to do is get the latest WUCN12 bulletin from the directory. As you can see they have a creation date, however I am unsure of how to grab the latest one of the WUCN12 bulletin. Any help would be great, Link to comment https://forums.phpfreaks.com/topic/282062-get-latest-file-from-directory/ Share on other sites More sharing options...
requinix Posted September 11, 2013 Share Posted September 11, 2013 It seems like the most reliable indicator is not the creation time but the filename suffix. '/(?Pass that string to preg_match_all, sort the [0] matches in reverse order, and grab the first one. Link to comment https://forums.phpfreaks.com/topic/282062-get-latest-file-from-directory/#findComment-1449068 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.