[Solved] Get total number of each day between two date in php
Try; define(‘ONE_WEEK’, 604800); // 7 * 24 * 60 * 60 function number_of_days($day, $start, $end) { $w = array(date(‘w’, $start), date(‘w’, $end)); return floor( ( $end – $start ) / ONE_WEEK ) + ( $w[0] > $w[1] ? $w[0] <= $day || $day <= $w[1] : $w[0] <= $day && $day <= $w[1] ); } … Read more