I'm trying to make date difference (in days) between today and a date from a field in database (array), this is my code :
$date1 = date_create ($v['sipp_ed']);//this is from field in database
$date2 = new DateTime();
$intval = date_diff ($date1, $date2);
echo $intval->format("Diiference is %a days");
but always get error "Passing null to parameter #1 ($datetime) of type string is deprecated". I have tried many times with other functions like strtotime, date, and getdate, but always fail.....could anybody help me, please ?