oracle765 Posted March 10, 2014 Share Posted March 10, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/ Share on other sites More sharing options...
jairathnem Posted March 10, 2014 Share Posted March 10, 2014 Since the API returns XML shouldnt it be something like this json_decode(json_encode((array)simplexml_load_string($xml)),1); Quote Link to comment https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/#findComment-1471998 Share on other sites More sharing options...
requinix Posted March 10, 2014 Share Posted March 10, 2014 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"]; } Quote Link to comment https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/#findComment-1472050 Share on other sites More sharing options...
oracle765 Posted March 11, 2014 Author Share Posted March 11, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/#findComment-1472101 Share on other sites More sharing options...
Solution oracle765 Posted March 11, 2014 Author Solution Share Posted March 11, 2014 and yeah will get a new one Quote Link to comment https://forums.phpfreaks.com/topic/286848-how-do-i-get-deeper-into-my-array/#findComment-1472102 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.