In this tutorial you will learn how to PHP date get month in a PHP web application.
PHP date get month
In this tutorial you will learn how to PHP date get month in a PHP web application. The date("M",strtotime("$date")) that return month name and if use m, that return month in number. The code of "php-date-get-month.php" given below as :
<?php $date =date('Y-m-d'); echo "Current date :: ".$date."<br>"; $month =date("M",strtotime($date))."(".date("m",strtotime($date)).")"; echo "Month : ".$month; ?>
Output :
when run "php-date-get-month.php" display output as :
[ 0 ] Comments