I'm calling an array from Postman API in which I have array like this in first image.
And getting its values inside my through this PHP code:
foreach ($request->room_prices as $roomCode => $roomPrices) {
$value .= $this->helper($roomCode, $roomPrices); // this is how its storing the prices of an id i.e. 569694
}
And now I've multiple arrays inside the api endpoint and I can't figure out a way to get the id and day values like (avail) & (no_ota) | Second image is the API request.
As in the rooms_availability array we have 2 objects: 1-ID and 2-Days.
And days also have multiple array like avail and no_ota.
I can't figure out the way I can call these avail, no_ota and id of room inside foreach loop.
foreach ($request->room_availabilities as $roomCodes => $roomCode) {
foreach ($roomCode => array_combine($avail, $no_ota)) {
$value .= $this->helper($roomCode, $avail, $no_ota);
}
}
Seeking experts guidance to get id, avail and no_ota through foreach loop into my function.