- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$datetime1 = strtotime("2017-03-31");
$datetime2 = strtotime(date('Y-m-d'));
$secs = $datetime1 - $datetime2;// == <seconds between the two times>
$days = $secs / 86400;
echo $days;