How many Sunday In Month:
function total_sundays($month,$year)
{
$sundays=0;
$total_days=cal_days_in_month(CAL_GREGORIAN, $month, $year);
for($i=1;$i<=$total_days;$i++)
if(date('N',strtotime($year.'-'.$month.'-'.$i))==7)
$sundays++;
return $sundays;
}
No Of Day in Month:
$no_day=cal_days_in_month(CAL_GREGORIAN,$month,$year);
function total_sundays($month,$year)
{
$sundays=0;
$total_days=cal_days_in_month(CAL_GREGORIAN, $month, $year);
for($i=1;$i<=$total_days;$i++)
if(date('N',strtotime($year.'-'.$month.'-'.$i))==7)
$sundays++;
return $sundays;
}
No Of Day in Month:
$no_day=cal_days_in_month(CAL_GREGORIAN,$month,$year);
Count sunday and Number of Day in month php
Reviewed by Anonymous
on
June 02, 2017
Rating:
No comments: