Connect with us

WEB SOLUTIONS DONE

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

php

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

 

 

 

 

 

 

 

 

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”;

Continue Reading
You may also like...

More in php

Advertisement




To Top