php script for date year only code example Example: php get current year $currentYear=date("Y");//2019