I want to calculate difference of two time in php (just time without Date). both time are in format AM/PM 12Hours like "6:35 PM" and "7:30 AM". how can i calculate difference and show result in minute. some codes in php like this
$time1 =' 6:30 AM';
$time2 = '7:45 AM';
$result = $time1 - $time2;
echo $result->format('%hh %im'); ///////////// show 1h 15m
if ($result(h) <1) ///////////////////////// if hours less than 1 hours
echo "do some things";
if ($result(h) >1) ////////////////////////if hours more than 1 hours
echo "do some things";
thank you very much