Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = 'http://dev.api.ean.com/ean-services/rs/hotel/v3/info?cid=55505
- &minorRev=28
- &apiKey=bhn947567fcqxznw5vxhu25p
- &locale=id_ID
- ¤cyCode=IDR
- &xml=
- <HotelInformationRequest>
- <hotelId>'.$id.'</hotelId>
- <options>0</options>
- </HotelInformationRequest>';
- $url = preg_replace('/\s+/', '', $url);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HTTPHEADER,array('Accept: text/xml,application/xml'));
- curl_setopt($ch, CURLOPT_FAILONERROR, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 15);
- $retValue = curl_exec($ch);
- curl_close($ch);
- //parse xml to object
- $model = new SimpleXMLElement($retValue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement