Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to Add Days to Date in PHP

by
Category:php
php
How to Add Days to Date in PHP

In this tutorial i will show you how to add days to date in PHP. Many project need this type speciality suppose, user subscribe account in 2 days need to two days add in current date. You may also like How to Convert date format yyyy-mm-dd => dd-mm-yyyy using PHP and How to add one day in current date using php.

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

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

The following source code will add 2 days to date.

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

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


0 Comments


Html code work in comment box


Related Post