How to get the number of days of the current month

Editorial Staff - - PHP Tutorials


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.