Use php to calculate the difference function of two dates. use php to calculate the difference function. The difference function of php computing two days is shared. The difference function of php computing is very simple and practical. the code is as follows: * ** date-calculate two dates. php calculates the difference function of two dates. php calculates the difference function.
Very simple and practical functions to share with you,
Code:
The code is as follows:
/**
* Date-calculate the difference between two dates
* @ Return int
*/
Public function get_difference ($ date, $ new_date ){
$ Date = strtotime ($ date );
$ New_date = strtotime ($ new_date );
Return abs (ceil ($ date-$ new_date)/86400 ));
}
It's super simple. I don't need to talk nonsense here. I hope my friends will like it.
The following code is provided to share functions that are very simple and practical. the code is as follows:/*** date-calculate two dates...