I have the array $roomResponse:
Array
(
[0] => Array
(
[0] => stdClass Object
(
[roomCategory] => Standard Room - Double
[paxes] => Array
(
[0] => stdClass Object
(
[paxType] => Adult
[age] => 30
)
[1] => stdClass Object
(
[paxType] => Adult
[age] => 30
)
[2] => stdClass Object
(
[paxType] => Child
[age] => 11
)
)
[totalRoomRate] => 280
[ratesPerNight] => Array
(
[0] => stdClass Object
(
[date] => 2015-06-08
[amount] => 40
)
[1] => stdClass Object
(
[date] => 2015-06-09
[amount] => 40
)
[2] => stdClass Object
(
[date] => 2015-06-10
[amount] => 40
)
)
)
[1] => stdClass Object
(
[roomCategory] => Standard Room - Double
[paxes] => Array
(
[0] => stdClass Object
(
[paxType] => Adult
[age] => 30
)
[1] => stdClass Object
(
[paxType] => Child
[age] => 11
)
[2] => stdClass Object
(
[paxType] => Child
[age] => 11
)
)
[totalRoomRate] => 274
[ratesPerNight] => Array
(
[0] => stdClass Object
(
[date] => 2015-06-08
[amount] => 40
)
[1] => stdClass Object
(
[date] => 2015-06-09
[amount] => 40
)
[2] => stdClass Object
(
[date] => 2015-06-10
[amount] => 40
)
)
)
)
How can i pull roomCategory and totalRoomRate. The above array COntains informations from information about two rooms. I want to use the as
$roomCategory[][]
and $totalRoomRate[][]
I have tried the below foreach but it doesnt work it return empty arrays.
foreach ($roomResponse as $camere) {
$roomCategory[][] = $camere->roomCategory;
$totalRoomRate[][] = $camere->totalRoomRate;
Thanks