Jump to content

how do i get deeper into my array


oracle765

Recommended Posts

Hi all

 

I am querying my array to pull out the values required but I am struggling to get the values out for [promoDescription] and [expediaPropertyId] how do I get to those to put them in the part of the table that's required

 

page attached you can see this on compareandchoose.com.au/json4.php

 

 

thanks in advance

json4.php

Link to comment
https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/
Share on other sites

oracle765, you just posted your private API key on the Internet. Deactivate it and get a new one.

 

Here's promoDescription. Try getting expediaPropertyId yourself.

Array
(
    [HotelListResponse] => Array
        (
            [HotelList] => Array
                (
                    [HotelSummary] => Array
                        (
                            [0] => Array
                                (
                                    [RoomRateDetailsList] => Array
                                        (
                                            [RoomRateDetails] => Array
                                                (
                                                    [RateInfos] => Array
                                                        (
                                                            [RateInfo] => Array
                                                                (
                                                                    [promoDescription] => Save 10%
foreach ($array["HotelListResponse"]["HotelList"]["HotelSummary"] as $summary) {
    echo $summary["RoomRateDetails"]["RateInfos"]["RateInfo"]["promoDescription"];
}
  foreach($response['HotelListResponse']['HotelList']['HotelSummary'] as $arr)
{

 $promodescription = $arr['RoomRateDetailsList']['RoomRateDetails']['RateInfos']['RateInfo']['promoDescription'];

thanks for that, that has helps lots it was slightly out but you pointed me in the right direction I used

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.