How to get year and month from a given date.
e.g. $dateValue = \'2012-01-05\';
$dateValue = \'2012-01-05\';
From this date I need to get year as 2012
Using date() and strtotime() from the docs.
$date = "2012-01-05"; $year = date('Y', strtotime($date)); $month = date('F', strtotime($date)); echo $month