PHP add days to current date

php add days to current date, PHP add days to current date, GTechHub

PHP add days to the current date is very easy and follows this article. I will guide you to add days to the current date using PHP. 

Refer to my previous article to add or subtract ‘N’ number of days from the current date.

PHP add days to current date samples:

Add 1 day to current date:

<?php
  $result = date('d.m.Y', strtotime('+1 day', time()));

  echo "Result: ".$result;
?>

Result

### Current date: 20.05.2020

Result: 21.05.2020

Add 2 day to current date:

<?php
  $result = date('d.m.Y', strtotime('+2 day', time()));

  echo $result;
?>

Result

### Current date: 20.05.2020

Result: 22.05.2020

Add 5 day to current date:

<?php
  $result = date('d.m.Y', strtotime('+5 day', time()));

  echo $result;
?>

Result

### Current date: 20.05.2020

Result: 25.05.2020

Add 7 day to current date:

<?php
  $result = date('d.m.Y', strtotime('+5 day', time()));

  echo $result;
?>

Result

### Current date: 20.05.2020

Result: 27.05.2020

php add days to current date, PHP add days to current date, GTechHub

You Might Also Like

Leave a Reply

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