php get current month code example
Example 1: php grab month from date
$month = date("m",strtotime($mydate));
Example 2: get current month php
current month
date('M');
date('F');
date('m');
Example 3: datetime get month php
$dateTime = new DateTime();
$month = $dateTime->format('m');
Example 4: 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']));
Example 5: php get current month first date
$start = date("Y-m-1 00:00:00");
$end = date("Y-m-d H:i:s");
$query = $this->db_model->run_query("select column_1, column_2 from table where date_column BETWEEN '".$start."' AND '".$end."'");