I have a big JSON object with lots of data in it. I want to print out a specific bit of data from it, but can't seem to find the right syntax for the print statement.
Here's the first bit of the json object so you can see the structure:
{"response":{"status":"OK","advertisers":[{"id":26243,"code":null,"name":"Tego","state":"inactive","default_brand_id":null,"remarketing_segment_id":null,"lifetime_budget":null,"lifetime_budget_imps":null,"daily_budget":null,"daily_budget_imps":null,"enable_pacing":null,"profile_id":508487,"control_pct":0,"timezone":"PST8PDT","last_modified":"2011-08-11 04:35:39","stats":null,"billing_internal_user":null,"billing_address1":"","billing_address2":"","billing_city":"","billing_state":"","billing_country":"","billing_zip":"","default_category":{"id":"5","name":"Computers and Electronics"},"default_currency":"USD","labels":[{"id":"1","name":"Salesperson","value":"Kurt Mackey"},{"id":"3","name":"Account Manager",}],"use_insertion_orders":false,"time_format":"12-hour","default_brand":null},
I want to return the ID of the first advertiser (which should be 26243).
I'm trying to print that out with this statement:
print $result->response->advertisers[0]->id
But it does not appear to be working. I get a blank white page.
What am I doing wrong?