How to get the number of days of the current month

This is a basic PHP program which describes how to get the number of days of the current month. Below examples will help you in the better understanding of the basic concept of PHP programming language.

How to get the number of days of the current month

We are using the if…else statement to determine the number of the days in a current month. Copy the below code and execute it with the help of PHP compiler.

Program Output

Total no of days in a current month: 30

Liked this program? Do Like & share with your friends.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers.