Posted inphp

how to display current month in PHP?

Today, We want to share with you current month in php.In this post we will show you php strtotime, hear for php date we will give you demo and example for implement.In this post, we will learn about php display current Date & time with an example.

PHP get the current month of a date

use the default date() function of PHP

Example 1: get current month

December is the month :)";
} else {
   echo "
The month is probably not December"; } ?>

Example 2: Full version:


Example 3: Short version:


How to get the first and last date of current month?


$first_day_this_month = date('m-01-Y'); 
$last_day_this_month  = date('m-t-Y');

$last_day_april_2010 = date('m-t-Y', strtotime('April 21, 2021'));

how to get the first and last days of a given month?


I hope you get an idea about get current year in php.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype