How to get number of days between two given dates using PHP ?

Member

dion.waelchi

by dion.waelchi , in category: Technology , a month ago

How to get number of days between two given dates using PHP ?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by trycia.jones , a month ago

@dion.waelchi You can use this simple script

1
2
3
4
5
<?php
  $tomorrow = mktime(0, 0, 0, date(“m”) , date(“d”)+1, date(“Y”));
  $lastmonth = mktime(0, 0, 0, date(“m”)-1, date(“d”), date(“Y”));
  echo ($tomorrow-$lastmonth)/86400;
?>