add days to date – How to Add Days to Date in PHP?

add days to date and display it. The PHP date function is used to format a date. here we can learn to main 2 Examples.

add days to date using PHP

Adding days to $current_data can be done in many ways. The following source code will added days to date.

Example 1: PHP Add Days to currentDate

21 days from today Example
php_add_days_to_date.php

<?php
  
    $myJoinDt = "2022-11-01";
    $latestDt = date('Y-m-d', strtotime($myJoinDt. ' + 21 days'));
  
    echo $latestDt;
  
?>

Result

2022-11-25

don’t miss : Sql Add Date

Also Read This πŸ‘‰   Session Flash Messages in Laravel 6 Tutorial

Example 2: PHP Add Days to Current Date

php_add_days_to_current_date.php

<?php
  
    $latestDt = date('Y-m-d', strtotime(' + 3 days'));
  
    echo $latestDt;
  
?>

Result

2022-11-06

I hope you get an idea about add days to date.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.