how to get thie year in php code example Example 1: php get year <?php echo date("Y"); ?> Example 2: php get current year $currentYear=date("Y");//2019