Is there any nice function in PHP to parse the date into parts given the specified format?
e.g.
some_function('20112000', 'dmY')
some_function('2000-11-20', 'Y-m-d')
some_function('2000 text 11-20', 'Y text m-d')
array('d'=>20, 'm'=>11, 'Y'=>2000)
expected in all of the above cases,
(assuming formats compatible with date()
function)
Update:
I use PHP 5.1.9
This is also possible using Zend_Date
, but it uses different formats than date()
(e.g. ddMMyyyy
)