function differenceInHours($startdate,$enddate){
$starttimestamp = strtotime($startdate);
$endtimestamp = strtotime($enddate);
$difference = abs($endtimestamp - $starttimestamp)/3600;
return $difference;
}
if(!empty($_POST["submit"])) {
$hours_difference = differenceInHours($_POST["startdate"],$_POST["enddate"]);
$message = "The Difference is " . $hours_difference . " hours";
}
$starttimestamp = strtotime($startdate);
$endtimestamp = strtotime($enddate);
$difference = abs($endtimestamp - $starttimestamp)/3600;
return $difference;
}
if(!empty($_POST["submit"])) {
$hours_difference = differenceInHours($_POST["startdate"],$_POST["enddate"]);
$message = "The Difference is " . $hours_difference . " hours";
}
Comments
Post a Comment