add days in date php
<?php
// PHP program to add days to $Date
// Declare a date
$date = "2019-05-10";
// Add days to date and display it
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?> $date = new DateTime('2020-11-24');
$date->add(new DateInterval("P9D"));
echo $date->format('Y-m-d');<?php
// adding extra days to date
// Steps:
// 1) using carbon
// 2) using strtotime
//Step 1
$date = date('Y M d h:i:s') // 2020 09 22 22:09:26 UTC
$new_date = Carbon::parse($date->addDays(1); // adds extra day
// Step 2
$date = date('Y M d h:i:s') // 2020 09 22 22:09:26 UTC
echo $new_date = date('Y M d h:i:s', strtotime($date. '+1 day'));
?>
Also in PHP:
- php + server + databse
- exist in string php
- facade laravel str number
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". when php is 7.4
- date compare php
- encode string to base64 php
- PHp and adys to date
- date add in php days
- find strign in string in php
- date format Y-m-d H:i:s and time zone in php
- convert y-m-d to timestamp php
- composer in serveur ionos
- Auth log out laravel
- array_push
- convert php array to javascript json laravel
- current date format in php
- convert json to array php
- date format Ymd php
- confirm popup laravel
- base64 decode
- find char in string php
- date time format in php
- echo console log
- display file error php