New Page – Useful Scripts
I have created a new page for featuring little snippets of code that I think others may find useful. Its name, quite uncreative, is “Useful Scripts”.
http://codemill.studio-connect.com/useful-scripts/
The first function posted is for getting the difference between two dates. This function takes two dates that are convertible to Unix timestamps using strtotime(), and will return an array of the number of years/months/days between the two dates. The number of days between a leap and non-leap year is not correct yet, that is on my to-do list.
PHP 5.3 introduces the new DateInterval class which will help parse dates and provide native dateDiff functionality to PHP. Until we are all on 5.3, hopefully this will help someone else.
Until next time.