Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tips How to Add Days to Date in PHP
#1
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
The following source code will add 2 days to current date.
Code:
<?php
   echo date('Y-m-d', strtotime(' + 2 days'));
?>

The following source code will add 2 days to date.
Code:
<?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.
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 56 11-12-2018, 04:38 PM
Last Post: Solomon
  Multiple file upload in php Kingsolomon 1 65 11-08-2018, 03:01 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 46 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 39 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 41 10-31-2018, 02:05 PM
Last Post: Kingsolomon

Forum Jump:


Users browsing this thread:
1 Guest(s)

How to Add Days to Date in PHP00