How can we know the number of days between two given dates using PHP?

$datevar1 = date(‘Y-m-d’);
$datevar2 = ‘2005-07-01’;
$daysvar = (strtotime() – strtotime()) / (60 * 60 * 24);
echo “Number of days since ‘2005-07-01’: $daysvar”;