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

Do you know what is the function func_num_args() used for?

976


What is the difference between explode and split?

979


What is the name of the scripting engine that powers PHP?

1181


Tell me how to initiate a session in php?

1044


What are hooks in php?

900


How to run the interactive php shell from the command line interface?

1041


What is a persistence cookie?

891


How to pad an array with the same value multiple times?

877


Explain about objects in PHP?

954


What is instantiation?

2167


What is php trait?

927


Is rent a variable cost?

900


How we get browser details of clients machine?

973


my english is not too good then what we apply for a php programer post

2537


what the new feature add in php 7.2?

914