Voor school ben ik met een project bezig dat gebruik maakt van JSON.
Als voorbeeld:
Deze pagina weergeeft JSON formated informatie. Deze output vang ik op mijn pagina op met cURL waaruit ik uiteindelijk deze decode met de json_decode() functie. Dit werkt natuurlijk allemaal goed.
Nu moet ik dus verschillende values gaan benaderen uit deze informatie.
Stel ik wil het eerste ID printen had ik in gedachten:
..hierboven staat de cURL functie...
$result = json_decode($result, true);
print $result->results[1]->id;
Aangezien ik geen output krijg (een lege pagina), zal dit wel fout zijn.
Heeft iemand enig idee hoe ik de values moet benaderen?
Een beter overzicht van het betreffende JSON format:

[size=xsmall]Toevoeging op 01/01/2014 18:48:30:[/size]
P.S. Heeft iemand een beter idee voor het managen van deze array's en objecten in PHP?
[size=xsmall]Toevoeging op 01/01/2014 19:15:29:[/size]
Eerste stukje van de var_dump:
array(3) { ["results"]=> array(50) { [0]=> array(18) { ["id"]=> int(17432) ["name"]=> string(12) "Pizza Alvino" ["category"]=> string(8) "Pizzeria" ["telephone"]=> string(11) "0182-582212" ["fax"]=> NULL ["website_url"]=> string(27) "http://www.pizza-alvino.nl/" ["tagline"]=> NULL ["rating"]=> int(93) ["url"]=> string(36) "http://www.eet.nu/gouda/pizza-alvino" ["created_at"]=> string(20) "2009-01-27T08:39:03Z" ["updated_at"]=> string(20) "2013-09-24T02:09:51Z" ["address"]=> array(5) { ["street"]=> string(15) "Nieuwehaven 159" ["zipcode"]=> string(7) "2801 CW" ["city"]=> string(5) "Gouda" ["region"]=> string(12) "Zuid-Holland" ["country"]=> string(15) "The Netherlands" } ["plan"]=> string(7) "regular" ["images"]=> array(2) { ["original"]=> array(0) { } ["cropped"]=> array(0) { } } ["resources"]=> array(5) { ["self"]=> string(30) "http://api.eet.nu/venues/17432" ["reviews"]=> string(38) "http://api.eet.nu/venues/17432/reviews" ["country"]=> string(32) "http://api.eet.nu/locations/1974" ["region"]=> string(30) "http://api.eet.nu/locations/12" ["city"]=> string(31) "http://api.eet.nu/locations/230" } ["geolocation"]=> array(2) { ["latitude"]=> float(52.0126991) ["longitude"]=> float(4.7064099) } ["counters"]=> array(3) { ["images"]=> int(0) ["menus"]=> int(0) ["reviews"]=> int(20) } ["relevance"]=> float(3.4295008) } [1]=> array(18) { ["id"]=> int(13344) ["name"]=> string(10) "Best Pizza" ["category"]=> string(8) "Pizzeria" ["telephone"]=> string(11) "045-5251905" ["fax"]=> NULL ["website_url"]=> string(23) "http://www.bestpizza.nl" ["tagline"]=> NULL ["rating"]=> int(86) ["url"]=> string(37) "http://www.eet.nu/brunssum/best-pizza" ["created_at"]=> string(20) "2009-01-27T08:25:00Z" ["updated_at"]=> string(20) "2013-12-20T03:09:26Z" ["address"]=> array(5) { ["street"]=> string(15) "Peerdendries 77" ["zipcode"]=> string(7) "6442 AT" ["city"]=>