How to Add Days to Date in PHP

Are you want to add days to date? Here is the solution to add days to the current date or desired date using PHP.

Add days to date

The following source code will add 5 days to date.
Source:

<?php
    $date 
"2015-11-17";
    echo 
date('Y-m-d'strtotime($date' + 5 days'));
?>

Result:

2015-11-22

Add days to current date

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

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

7 Comments

  1. Su Said...
  2. Hearvey Said...
  3. Micheal Said...
  4. John Said...
  5. Mohamad Javad Zolghadr Said...
  6. Amit Shee Said...
  7. Anuj Said...

Leave a reply

keyboard_double_arrow_up