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 and month as January.
Use strtotime():
strtotime()
$time=strtotime($dateValue); $month=date("F",$time); $year=date("Y",$time);
1.4m articles
1.4m replys
5 comments
57.0k users