Determine difference between two dates in PHP

It is possible to determine difference between two dates in PHP using diff method. This methos is part of the actions of the DateTime object. Two datetime objects need to be created with date and time desired in to use diff method, This method  will result in an object, which will contain properties with difference in years, months, days, hours, minutes and seconds.

In addition to this detailed information, it is possible to find out total difference in days between these two objects using days property.

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator