I want to add two time() and get the result. for example i get time1 as 1395897426 and time2 as 1395897487 now i want to add those two time in a variable time3 and convert it to hours and minutes
<?php
$time1 =time();
$time2 = time();
$time3 = $time1+$time2;
echo $time3;
?>
actually am using a function to find time difference. function time_diff($start,$end)
{
$time1 = date('H:i',$start);
$time2 = date('H:i',$end);
list($hours, $minutes) = explode(':', $time1);
$startTimestamp = mktime($hours, $minutes);
list($hours, $minutes) = explode(':', $time2);
$endTimestamp = mktime($hours, $minutes);
$seconds = $endTimestamp - $startTimestamp;
$minutes = ($seconds / 60) % 60;
$hours = round($seconds / (60 * 60));
echo "<b>$hours</b> hours and <b>$minutes</b> minutes";
}