Extracting date from a string in PHP

只谈情不闲聊 提交于 2019-12-11 10:04:08

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/8034833/extracting-date-from-a-string-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!