How to get difference of two datetime values in PHP

Sometimes we have to calculate the age of a member or the number of days since the member has logged into the system. This can easily be done in mySQL by using the datediff function however it’s always a good …