这篇文章主要介绍了php计算2个日期的差值函数分享,非常实用,推荐给有需要的小伙伴。
非常简单实用的函数分享给大家,,
奉上代码:
复制代码 代码如下:
/**
* 日期-计算2个日期的差值
* @return int
*/
public function get_difference($date, $new_date) {
$date = strtotime($date);
$new_date = strtotime($new_date);
return abs(ceil(($date - $new_date)/86400));
}
超级简单,这里就不多废话了,希望小伙伴们能够喜欢。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment