0

私は API 呼び出しと学習段階ではまったく新しいものです。私はphpを使用してExpedia開発APIを使用しています。応答ダンプを正常に取得しており、ページにダンプを表示できます。ただし、そのAPI応答を変換/解析し、その場でWebページに変換する必要があることを誰かが教えてくれますか? その出力を使用してhtmlに変換し、通常の休日の予約やホテルのWebサイトと同じように表示する方法を理解するのに本当に苦労しています。理解を深めるために、Expedia から受け取った回答を貼り付けます。お知らせ下さい

 [HotelSummary] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [order] => 0
                    )

                [hotelId] => 425669
                [name] => Hôtel Luxor
                [address1] => 24, Rue Ernest Renan
                [city] => Issy-les-Moulineaux
                [postalCode] => 92130
                [countryCode] => FR
                [airportCode] => SimpleXMLElement Object
                    (
                        [0] =>    
                    )

                [supplierType] => E
                [propertyCategory] => 1
                [hotelRating] => 1.0
                [confidenceRating] => 52
                [amenityMask] => 0
                [tripAdvisorRating] => 1.5
                [locationDescription] => Near Paris Expo Porte de Versailles
                [shortDescription] => <p><b>Location. </b> <br />Hôtel Luxor is located in Issy-les-Moulineaux's Gare Montparnasse - Porte de Versailles neighborhood, close to Paris Expo Porte de Versailles, Eiffel Tower, and Stade de
                [highRate] => 43.76
                [lowRate] => 43.76
                [rateCurrencyCode] => EUR
                [latitude] => 48.82882
                [longitude] => 2.28239
                [proximityDistance] => 1.7304468
                [proximityUnit] => MI
                [hotelInDestination] => true
                [thumbNailUrl] => /hotels/6000000/5670000/5669900/5669864/5669864_4_t.jpg
                [deepLink] => http://travel.ian.com/index.jsp?pageName=hotAvail&cid=55505&hotelID=425669&mode=2&numberOfRooms=1&room-0-adult-total=1&room-0-child-total=0&arrivalMonth=8&arrivalDay=17&departureMonth=8&departureDay=18&showInfo=true&locale=en_US&currencyCode=EUR
                [RoomRateDetailsList] => SimpleXMLElement Object
                    (
                        [RoomRateDetails] => SimpleXMLElement Object
                            (
                                [roomTypeCode] => 200245723
                                [rateCode] => 201427808
                                [maxRoomOccupancy] => 2
                                [quotedRoomOccupancy] => 1
                                [minGuestAge] => 0
                                [roomDescription] => Moderate - shared bathroom
                                [currentAllotment] => 10
                                [propertyAvailable] => true
                                [propertyRestricted] => false
                                [expediaPropertyId] => 5669864
                                [rateKey] => 3f0bfd6a-d45b-496d-a986-eb8aade2b3e8
                                [RateInfo] => SimpleXMLElement Object
                                    (
                                        [@attributes] => Array
                                            (
                                                [rateChange] => false
                                                [promo] => false
                                                [priceBreakdown] => true
                                            )

                                        [ChargeableRateInfo] => SimpleXMLElement Object
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [total] => 47.0
                                                        [surchargeTotal] => 3.24
                                                        [nightlyRateTotal] => 43.76
                                                        [maxNightlyRate] => 43.76
                                                        [currencyCode] => EUR
                                                        [commissionableUsdTotal] => 57.72
                                                        [averageRate] => 43.76
                                                        [averageBaseRate] => 43.76
                                                    )

                                                [NightlyRatesPerRoom] => SimpleXMLElement Object
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [size] => 1
                                                            )

                                                        [NightlyRate] => SimpleXMLElement Object
                                                            (
                                                                [@attributes] => Array
                                                                    (
                                                                        [promo] => false
                                                                        [rate] => 43.76
                                                                        [baseRate] => 43.76
                                                                    )

                                                            )

                                                    )

                                                [Surcharges] => SimpleXMLElement Object
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [size] => 1
                                                            )

                                                        [Surcharge] => SimpleXMLElement Object
                                                            (
                                                                [@attributes] => Array
                                                                    (
                                                                        [amount] => 3.24
                                                                        [type] => TaxAndServiceFee
                                                                    )

                                                            )

                                                    )

                                            )

                                    )

                                [ValueAdds] => SimpleXMLElement Object
                                    (
                                        [@attributes] => Array
                                            (
                                                [size] => 1
                                            )

                                        [ValueAdd] => SimpleXMLElement Object
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [id] => 2048
                                                    )

                                                [description] => Free Wireless Internet
                                            )

                                    )

                            )

                    )

            )

    )

  )
4

1 に答える 1