Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well i think JSON function work on your machine. I think so because of the error which you get. Also example from DanFromGermany should work but URL is kind of long so maybe it was cut off. Here is what you can try:</p> <p>1.) Go here: <a href="https://api.eancdn.com/api/tester/" rel="nofollow">https://api.eancdn.com/api/tester/</a> and choose from links above what you want to parse. I tried with "Hotel List". So click on link "Hotel List", choose JSON format and click proceed. Then you will see entire link bellow (it's long). Right click and copy it. </p> <p>2.) This PHP code should work (it worked for me) it's just a little bit complicated structure of JSON and then ARRAY so important data is pretty DEEP :)</p> <pre><code>$url = "https://api.eancdn.com/ean-services/..."; //(ENTIRE URL HERE - its LONG) $arr = json_decode(file_get_contents($url), true); // true is for array, false for objects //parse data from array $arr['HotelListResponse']['HotelList']['HotelSummary'] foreach ($arr['HotelListResponse']['HotelList']['HotelSummary'] as $hotel){ $hname = $hotel['name']; //get hotel name from array $hid = $hotel['hotelId']; //get hotel id from array $haddress = $hotel['address1']; //get hotel address1 from array echo "&lt;b&gt;Hotel name:&lt;/b&gt; $hname Hotel ID: $hid Hotel address 1: $haddress &lt;br&gt;"; } </code></pre> <p>3.) There are also other data which you can get it for each hotel. Check some samples and return data here: <a href="http://www.zaposlitev1a.com/tmp/json1.php" rel="nofollow">JSON1 (return array)</a> and here for <a href="http://www.zaposlitev1a.com/tmp/json2.php" rel="nofollow">some parsed data like hotel id, hotel address etc. - same PHP code as above</a> - 2.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload