Breaking News

Count sunday and Number of Day in month php

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);

No comments