Find out total days of two date difference

Author Name : Md. Shahab uddin Category Name : PHP

Find out total days of two date difference

$datetime1 = date_create('2020-01-01');
$datetime2 = date_create('2020-01-25');
$interval = date_diff($datetime1, $datetime2);
echo $interval->format('%a days');

$datetime1 = date_create('2020-01-01');
$datetime2 = date_create('2020-01-25');
$interval = date_diff($datetime1, $datetime2);
echo $interval->format('%a days');