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

Count sunday and Number of Day in month php Count sunday and Number of Day in month php Reviewed by Anonymous on June 02, 2017 Rating: 5

No comments:

Java Ternary Operator

Java Ternary Operator Java ternary operator is the only conditional operator that takes three operands. Java ternary operator is a one l...

Powered by Blogger.