add days to date in 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:
- convert xml file to array php
- composer laravel project
- find string exist in string php
- find if string contains characters php
- create project larave
- explode php
- check array key exists php js
- date F month php
- array key exists and is true
- class 'illuminate support facades input' not found laravel 7
- creating thumbnail in codeigniter
- create project via composer
- create controller in laravel command line
- database connectivity in php
- create table and insert data in wordpress plugin
- curl multi exec
- dump all variables twig
- eloquent using last()
- cache clear laravel command
- Get last id in laravel
- breaking long array in php
- Allowed memory size of 1610612736 bytes exhausted composer require laravel windows
- add more data to variable php
- How to use mbstring on Heroku (PHP)