title: Parsing nested json array value in php
body: <p>I am trying to parse the data from the following json</p>
  
  <pre><code>{
  "id":"1",
  "rawId":"1",
  "displayName":"Distress Number",
  "name":{"familyName":"Number","formatted":"Distress Number","givenName":"Distress"},
  "nickname":null,
  "phoneNumbers":[{"type":"other","value":"112","id":"2","pref":false}],
  "emails":[{"type":"other","value":"blessan004@gmail.com","id":"19","pref":false}],
  "addresses":null,
  "ims":null,"organizations":null,
  "birthday":null,
  "note":"","photos":null,
  "categories":null,
  "urls":null
  }
  </code></pre>
  
  <p>I want to insert the <code>displaName</code>,<code>phoneNumbers</code> and <code>emails</code> to database table but its failed
  Here is my php </p>
  
  <pre><code>$contact=json_decode($json,true){
      foreach($contact as $con){
  
           $num=$con['phoneNumbers']['value'];
          $name=$con['displayName'];
          $email=$con['emails']['value'];
           //function to dbinsert 
          insertToDb($num,$name,$email);
       }
  </code></pre>
  
  <p>But it returns <code>illegal offset warning</code></p>