I have this text ($results):
{"data":{"summary":{"records":67,"page":1,"total":67,"hasMore":0},"reservations":[{"id":1111111,"property":"villadianna","from":"2016-07-18","to":"2016-07-25"},"pricing":{"price":1164.2400,"currency":"EUR","retail":1323},"clientInfo":{"firstName":"pera","lastName":"peric","email":"[email protected]"},"status":1,"offline":0},{"id":222222,"property":"villadianna", etc. ... ...
Now I need to get reserations array and make foreach loop so I try:
...
$result = curl_exec($ch);
curl_close($ch);
$json = json_decode($result);
foreach ($json->reservations as $element) {
print_r($element);
}
How to create html table with foreach loop only for reservations ?

print_r($json);and look at the object you are dealing with.$json->data->reservationsvar_dump()only use it if I really have to andprint_r()does not show enough detail which is rare in my experince but you are probably right$jsonobject looks like read it and understand its structure. If you read the lables you will seestdClass(means an object) orArray(means an array)