I have an array with times (string) e.g \"2:23\", \"3:2:22\" etc.
$times = array(\"2:33\", \"4:2:22\", \"3:22\") //loner
I want to find the
So you want to add a duration to a time, meaning add a number of hours, minutes and seconds to a time?
Perhaps you might use Dav's strtotime to get the seconds from midnight for the time, then add the duration using an sscanf, thus:
$midnight = strtotime("0:00");
// ssm = seconds since midnight
$ssm1 = strtotime("2:33") - $midnight;
// sscanf the time string... you might need to include the possibility of seconds
list($hour, $minute) = sscanf("3:33", "%d:%d");
// a
$answer_ssm = $ssm + $hour * 3600 + $minute * 60;
echo strftime("%H:%M:%S", $answer_ssm);
Can't test this from where I am so pls excuse any syntax errors... just trying to give an example. You'll also need to iterate across your array of course.