How to Add Months to Date in PHP

In this tutorial i will show you how to add months to date in PHP. Many project need this type speciality suppose, user subscribe account in 2 months need to two months add in current date. You may also like How to add one month in current date using php and How to add one day in current date using php.

The following source code will add 2 months to current date.

<?php
    echo date('Y-m-d', strtotime(' + 2 month')); 
?>

The following source code will add 2 months to date.

<?php
    $date = "2018-05-19";
    echo date('Y-m-d', strtotime($date. ' + 2 month'));
?>

And if you like this tutorials please share it with your friends via Email or Social Media.

Leave a Reply

Your email address will not be published. Required fields are marked *