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
What is php mainly used for?
How values in arrays are indexed?
Is empty array php?
What is php data type?
How to include variables in double-quoted strings?
Which will start a session?
What are computer variables?
What is PHP's configuration file called?
What is the main difference between php 4 and php 5?
What's the output of the ucwords function in this example?
Where are php configuration settings stored?
What is php ci?
Does wordpress run on php 7?
How many types of errors in php?
Explain me the difference between include and require?