php get days of month code example
Example 1: php grab month from date
$month = date("m",strtotime($mydate));
Example 2: php days in month
// For given month
echo cal_days_in_month(CAL_GREGORIAN, 1, 2021);
// For current month
echo date('t');
Example 3: datetime get month php
$dateTime = new DateTime();
$month = $dateTime->format('m');