1

How can I extract the date from an arbitrary string such as "Joe Soap was born on 12 February 1981"?

Python has a wonderful fuzzy parsing functionality provided by python-dateutil as described in this question.

I'm looking for a library that provides the same type of functionality in PHP.

Hassaan
  • 6,770
  • 5
  • 29
  • 47
Richard Keller
  • 1,970
  • 2
  • 19
  • 32

1 Answers1

3

What about date_parse , but if you know your date format, just use the regex to get what you want.

xdazz
  • 154,648
  • 35
  • 237
  • 264
  • date_parse() is exactly what I was looking for and provides fuzzy date matching. Regex is not an option since the input format is unknown. – Richard Keller Nov 07 '11 at 10:31