Antara dua tanggal hitungan hari dan dihapus hari Minggu menggunakan PHP
<?php
function getalldates($strtdate,$enddate){
$array = array();
$period = new DatePeriod(
new DateTime($strtdate),
new DateInterval('P1D'),
new DateTime($enddate)
);
foreach ($period as $key => $value) {
$Store = $value->format('Y-m-d');
$unixTimestamp = strtotime($Store);
$dayOfWeek = date("l", $unixTimestamp);
if($dayOfWeek != "Sunday"){
$array[] = $Store;
}
}
return count($array);
}
$fdate = "2022-02-01";
$ldate = "2022-02-28";
$c = getalldates($fdate,$ldate);
echo $c;
?>
faheem