Jump to content

how do i get deeper into my array


oracle765
Go to solution Solved by 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
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"];
}
Link to comment
Share on other sites

  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

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.