php extract year month from date code example
Example 1: php grab year from date
$year = date("y",strtotime($mydate));
Example 2: php grab month from date
$month = date("m",strtotime($mydate));
$year = date("y",strtotime($mydate));
$month = date("m",strtotime($mydate));