Array med Class objekt kondensering
Hej EksperterJeg har sat mig overfor en udfordring, og jeg kan ikke lige finde ud af hvordan jeg skal løse den.
Jeg har dette i $Weekdays:
Array
(
[0] => stdClass Object
(
[day] => Monday
[openAt] => stdClass Object
(
[From] => 05:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[1] => stdClass Object
(
[day] => Tuesday
[openAt] => stdClass Object
(
[From] => 05:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[2] => stdClass Object
(
[day] => Wednesday
[openAt] => stdClass Object
(
[From] => 05:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[3] => stdClass Object
(
[day] => Thursday
[openAt] => stdClass Object
(
[From] => 05:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[4] => stdClass Object
(
[day] => Friday
[openAt] => stdClass Object
(
[From] => 05:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[5] => stdClass Object
(
[day] => Saturday
[openAt] => stdClass Object
(
[From] => 06:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
[6] => stdClass Object
(
[day] => Sunday
[openAt] => stdClass Object
(
[From] => 06:30
[To] => 22:00
)
[breaks] => stdClass Object
(
)
)
)
Hvordan kan jeg kondensere det så jeg får dette output:
Monday - Friday (05:30-22:00)
Saturday - Sunday (06:30-22:00)
Pft.