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 / ashish kumar

/* $day = 0 for counting sunday. If you want to count
any other day in a month then set the $day accordingly.
For example $day = 3 for wednesday
*/
$day = 0;
$temp = date('j') - date('w') + $day ;
$count_day_in_a_month = (int)($temp/7) + (int)((date('t') -
$temp)/7) + 1;

Is This Answer Correct ?    13 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of implode() function?

1148


How long should a session last?

1020


Which escape sequences can be used in single quoted strings in php?

982


What is a php 5?

1158


What good is polymorphism?

996


Does php need html?

1043


Explain Booleans in PHP?

1132


How to split a string into array using php?

1261


What is a lambda function in php?

1175


What is overriding in php?

1140


Is php still in demand?

1092


Which parts of php are case sensitive?

973


Where is my php ini file?

1131


What are the difference between array_keys() and array_key_exists() in php?

1130


Is php 5.6 secure?

1043