Difference in days between two dates with PHP

<?php

$date1 = strtotime("2019-02-01");
$date2 = strtotime("2019-07-26");

$diff_unix = $date2 - $date1;
$diff_days = floor($diff_unix/3600/24);

echo $diff_days;

// Result: 175

Leave a Comment

Your email address will not be published. Required fields are marked *