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