I have a function as follows:
function DateDiff($d1, $d2)
{
$date1 = new DateTime($d1);
$date2 = new DateTime($d2);
return $date1->diff($date2)->days; //return no of days
}
I want to pass a third parameter something like this:
function DateDiff($d1,$d2,$convert){
}
and convert the result in seconds or minutes. Is there any default PHP function for that?
Thanks in advance!