I am very fresh in PHP language. I trying to create a small application about how to adding 1 year in specific date. Please suggest me.
In PHP provides method to add 1 year easily. The syntax given below will show how to add 1 year in php program. This may be help you to develop the application.
Example : ---
<?php //Example to add 1 year to a date object $currentDate = date("Y-m-d");// current date //Display the current date echo "Current Date: ".$currentDate."<br>"; //Add one year to current date $dateOneYearAdded = strtotime(date("Y-m-d", strtotime($currentDate)) . " +1 year"); echo "Date After adding one year: ".date('l dS \o\f F Y', $dateOneYearAdded)."<br>"; ?>