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 is mvc in php?

1009


Explain preg_Match and preg_replace?

996


What are session variables in php?

1041


Explain what does the expression exception::__tostring means?

876


Is php a middleware?

964


Explain about a search-friendly site looks like?

864


Why use static methods php?

1085


What is alias in php?

1039


Explain how you can update memcached when you make changes to php?

1150


How to join multiple strings into a single string?

968


Explain me what are the 3 scope levels available in php and how would you define them?

1214


What is difference between session and cookies in php?

970


Tell me what is the use of explode() function?

988


How do I make a reset button in html?

1006


Which MySQL function would you use to select a database?

1069