<?php
function OtherDAY($start,$total){
$date = new DateTime("$start");
$date->add(new DateInterval('P'.$total.'D'));
$finish=$date->format('Y-m-d');
return $finish;
}
$start=date("Y-m-d");
$otherday=OtherDAY("$start",'15');
die($otherday);`
?>`
It is showing me “not a date format” after i kill it, how to fix this?
Change:
To
And
To
You are not passing the value of the variable in, as you are passing it in as a string