I am trying to make a function to calculate the time difference of two values, but my return in my code below gives me unexpected string, how come?
var mf_start_time = "10:30:30";
var mf_end_time = "11:10:10";
function time_interval(mf_start_time,mf_end_time)
{
$s = strtotime($start_time);
$e = strtotime($end_time);
if ($s < $e)
{
$a = $e - $s;
}
else
{
$e = strtotime('+1 day',$e);
$a = $e - $s;
}
$h = floor($a/3600);
$m = floor(($a%3600)/60);
$s = $a%60;
return trim(($h?$h.' hour ':'').($m?$m.' minute ':'').($s?$s.' second ':''));
}

$s.' second'needs to be$s + ' second'time_intervalfunction, such astrim,floorandstrtotimeare PHP methods so the concatenation method would be the period (.) rather than plus sign(+)