Jump to content

How to get the Date from Filenames?


lopes_andre

Recommended Posts

Hi,

 

I have the following situation:

 

Array ( 
[5] => GeoLiteCity_20090601.zip 
[6] => GeoLiteCity_20090701.zip 
[7] => GeoLiteCity_20090801.zip 
[8] => GeoLiteCity_20090901.zip 
[9] => GeoLiteCity_20091001.zip 
[10] => GeoLiteCity_20091101.zip 
[11] => GeoLiteCity_20091201.zip 
[12] => GeoLiteCity_20100101.zip 
[13] => GeoLiteCity_20100201.zip 
[14] => GeoLiteCity_20100301.zip 
[15] => GeoLiteCity_20100401.zip 
[16] => GeoLiteCity_20100501.zip 
[17] => GeoLiteCity_20100601.zip 
[18] => GeoLiteCity_20100701.zip 
[19] => GeoLiteCity_20100801.zip 
[20] => GeoLiteCity_20100901.zip 
[21] => GeoLiteCity_20101001.zip 
[22] => GeoLiteCity_20101101.zip 
[23] => GeoLiteCity_20101201.zip 
     ) 

 

I have this array with filenames, the patern for the name of the file is NAME_DATE.zip

 

I need to get from this array the most recent file(GeoLiteCity_20101201.zip). Which is the best way of doing this task?

 

Give me some clues.

 

 

Best Regards,

Link to comment
https://forums.phpfreaks.com/topic/222216-how-to-get-the-date-from-filenames/
Share on other sites

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.