I'd like to extract a date from any string entered. But not specific to a date format (otherwise I'd use some sort of regex)
e.g
"Pictures taken in Africa 3 weeks ago"
The php parser would extrace "3 weeks ago" and I can happily convert this.
Does anyone know of the best method to perform this or of any library that can do it for me. I determined looping through all possible combinations of strings within the input wouldn't b a good idea.
Thanks guys
Pekka made a good point.
In the event of multiple strings detected for use with the strtotime() function, I would perform seom magic on my part. Maybe designing some sort of conetext algorithm. But I don't expect you chaps to have to worry about that bit as well. I'm uber happy to revieve the understanding of how to extract this date bit.
More Examples
last week at the albert hall concert.
taken 5 years ago in paris with Emily.
All these pictures we taken at the new place in december
- Stuff like that really.