get month from date php code example
Example 1: get last month php
$currentMonth = date('M');
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
Example 2: get current month php
current month
date('M');
date('F');
date('m');
Example 3: php grab month from date
$month = date("m",strtotime($mydate));
Example 4: datetime get month php
$dateTime = new DateTime();
$month = $dateTime->format('m');
Example 5: get month from database php
echo 'Day' . date('d', strtotime($row['Date']));
echo 'Month' . date('m', strtotime($row['Date']));
echo 'Year' . date('Y', strtotime($row['Date']));