- floor: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$startdate_2015 = strtotime(date('2015-03-25'));
$enddate_2015 = strtotime(date("2015-03-28"));
$nights_2015 = floor($enddate_2015 - $startdate_2015);
echo 'nights in 2015: '.$nights_2015 = floor($nights_2015/(60*60*24));
echo '<p>';
$startdate_2016 = strtotime(date('2016-03-25'));
$enddate_2016 = strtotime(date("2016-03-28"));
$nights_2016 = floor($enddate_2016 - $startdate_2016);
echo 'nights in 2016: '.$nights_2016 = floor($nights_2016/(60*60*24));
echo '<p>';
$startdate_2017 = strtotime(date('2017-03-25'));
$enddate_2017 = strtotime(date("2017-03-28"));
$nights_2017 = floor($enddate_2017 - $startdate_2017);
echo 'nights in 2017: '.$nights_2017 = floor($nights_2017/(60*60*24));
echo '<p>';
$startdate_2018 = strtotime(date('2018-03-25'));
$enddate_2018 = strtotime(date("2018-03-28"));
$nights_2018 = floor($enddate_2018 - $startdate_2018);
echo 'nights in 2018: '.$nights_2018 = floor($nights_2018/(60*60*24));
echo '<p>';
$startdate_2019 = strtotime(date('2019-03-25'));
$enddate_2019 = strtotime(date("2019-03-28"));
$nights_2019 = floor($enddate_2019 - $startdate_2019);
echo 'nights in 2019: '.$nights_2019 = floor($nights_2019/(60*60*24));
echo '<p>';