$to = strtotime("2008-12-13 10:42:00");
$from = strtotime("2008-12-13 10:21:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";
echo round(abs($to_time - $from_time) / 3600,2). " hours";
It is working good when I convert into minutes, but when converting into hours it's not giving the correct output.