Letter Letter - 7 months ago 21
PHP Question

Php date add 1 year to current date

I have this php code right here:

$end=date('Y-m-d');


I use it in order to get current date, i need to add 5 years to the current date, something like:

$end=date('(Y + 5)-m-d');


Someone help me how to achieve it?
Thanks

hsz hsz
Answer

Try with:

$end = date('Y-m-d', strtotime('+5 years'));