From the database I get an array containing the following values (as time):
- 00:00
- 00:02
- 00:01
- 00:02
- 00:02
- 00:02
I would like to sum this values and return the number of seconds.
I wrote a PHP script like this:
for ($i = 0; $i < count($values); $i++) {
$time += strtotime($values[$i]);
}
echo date('s', strtotime($time);
But I get 00 as output.
What am I doing wrong?
Thank you.