I have an Array wich outputs are the following Strings: Date(Datetime)
, Duration(Time)
. There are Multiple same days with different times.
For Example:
2019-03-04 00:00:00 |
01:00:00
2019-03-04 00:00:00 |
00:05:00
2019-03-05 00:00:00 |
00:30:00
2019-03-05 00:00:00 |
00:15:00
Now I want to look for the same days and add all the Time Values
for each day into one Time String
.
My code looks something like this (simplified):
$sql_query = "SELECT date, time_in_minutes FROM user;
$result_sql = $db->query($sql_query);
while($sql_query = $result_sql->fetchrow(DB_FETCHMODE_ASSOC))
{
echo $row_employee_data['date'];
echo "<br/>";
echo $row_employee_data['time_in_minutes'];
echo "<br/>";
echo "<br/>";
}
/*
Output:
2019-03-05 00:00:00
00:15:00
*/
THe expected output should be an Multidimensional array wich outputs all Dates
once with the other value beeing the Duration Time
added together. For example:
2019-03-04 00:00:00
01:05:00
2019-03-05 00:00:00
00:45:00