Have a quick question regarding parsing json. I believe my code is valid however it doesn't display a response when i search for specific key / value. I can however return the response->uri just fine but can't get anything other than that or the full file.
- function GetLeads()
- {
- $file = fopen("https://crm.zoho.com/crm/private/json/Leads/searchRecords?authtoken=API KEY&scope=crmapi&criteria=(Last%20Name:test)", r) or exit("Unable to Open File!");
- while(!feof($file))
- {
- $theData = fgets($file);
- }
- fclose($file);
- $jsonObj = json_decode($theData);
- // print_r($jsonObj->response->result->Leads->row); // displays the results just fine.
- // echo $theData; // displays the result just fine.
- // echo $jsonObj->response->uri; // displays the URI
- echo $jsonObj->response->result->Leads->row->FL->Email; // doesn't display anything
- }
I've tried varius combinations of Leads->row->no->FL and even tried ->val but nothing works. A little nudge in the right direction would be helpful and thank you.