Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to count how many sundays in month?

Answer Posted / koushikgraj

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;
}
echo total_sundays(1,2011);

Is This Answer Correct ?    45 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the timeout period on session values?

1135


How can image properties be retrieved in php?

1046


What is the use of the function htmlentities?

1164


What is the use of inner join in mysql?

1035


Is it possible to use com component in php?

1033


How cookies are transported from servers to browsers?

1035


Is php a web server?

1043


How to create a mysql connection?

1022


Can we learn php without html?

1038


How do you measure variables?

1113


What exactly is PHP?

1062


What are the benefits of using php?

1074


What is the use of addslashes in php?

988


What is cookie and session in php?

1002


Explain setcookie() function in php?

1077