Если по замыслу
Владимир Проскурин $openingHours = [
['day' => 'monday', 'time' => '08:00-20:00'],
['day' => 'tuesday', 'time' => '08:00-20:00'],
['day' => 'wednesday', 'time' => '08:00-20:00'],
['day' => 'thursday', 'time' => '10:00-20:00'],
['day' => 'friday', 'time' => '10:00-18:00'],
['day' => 'saturday', 'time' => '10:00-16:00'],
['day' => 'sunday', 'time' => '10:00-16:00'],
];
$temp = array();
$result = array();
foreach($openingHours as $key => $item) {
$temp[$item['time']][] = $item['day'];
}
foreach($temp as $key => $item){
$count = count($item) -1;
$count >= 1 ? $result[$item[0].'-'.$item[$count]] = $key : $result[$item[0]] = $key;
}
print_r($result);
Array
(
[monday-wednesday] => 08:00-20:00
[thursday] => 10:00-20:00
[friday] => 10:00-18:00
[saturday-sunday] => 10:00-16:00
)
P.S. На другие реализации или упрощение вышеописанного и сам с удовольствием посмотрю