Add 30 days to date

In PHP, you can add 30 days to a date by using the DateTime class and the modify() method. Here is an example of how to do this:

<?php

$date = new DateTime();
$newDate = $date->modify('+30 days');
echo $newDate->format('Y-m-d');

Watch a course Learn object oriented PHP

You can also use the add() method instead of modify() method, which takes a DateInterval object as its argument. Here is an example:

<?php

$date = new DateTime();
$interval = new DateInterval('P30D');
$date->add($interval);
echo $date->format('Y-m-d');

Both of the above examples will output the date 30 days from the current date in the format 'Y-m-d'.