>>> Programming >> PHP > How to find the number of days in a month with PHP Date (This page has been seen 728 times)
How to find the number of days in a month with PHP Date
This is an example on how to find the number of days in a month
The Code:
The Code:
$Month = date("m");
$Year = date("y");
$DaysInMonth=cal_days_in_month(CAL_GREGORIAN,$Month,$Year);
echo "The month $Month has $DaysInMonth days";
Like (0)
Dislike (0)
Keywords for this article:
DATE || YEAR || CAL_GREGORIAN
Advertisement by Google
Comment:
Code Language:
Code:
Here you can paste a code example. It will then be processed by SyntaxHighlighter and formatted for easier readability.
Please remember to select the correct Code Language in the select above so the SyntaxHighlighter can highlight the code properly.
Code:
Please enter the code you see above
What is 3 + 7 =