PHP calculation difference function sharing between two dates, PHP calculation difference function
A very simple and practical function to share with everyone,
Provide the code:
Copy 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));
}
Super simple, no more nonsense here, I hope you guys like it.
http://www.bkjia.com/PHPjc/951637.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/951637.htmlTechArticlePHP calculation difference function between two dates is shared. PHP calculation difference function is a very simple and practical function to share with everyone. , here is the code: Copy the code as follows: /** * Date-calculate 2 dates...