php to get year from sql date code example Example: php grab year from date $year = date("y",strtotime($mydate));