title: How to decode a JSON String with several objects in PHP?
body: <p>I know how to decode a JSON string with one object with your help from this example <a href="https://stackoverflow.com/questions/2543389/how-to-decode-a-json-string">How to decode a JSON String</a></p>
  
  <p>But now I would like to improve decoding JSON string with several objects and I can't understand how to do it.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>{ "inbox": [
    { "firstName": "Brett", "lastName":"McLaughlin" },
    { "firstName": "Jason", "lastName":"Hunter" },
    { "firstName": "Elliotte", "lastName":"Harold" }
   ],
  "sent": [
    { "firstName": "Isaac", "lastName": "Asimov" },
    { "firstName": "Tad", "lastName": "Williams" },
    { "firstName": "Frank", "lastName": "Peretti" }
   ],
  "draft": [
    { "firstName": "Eric", "lastName": "Clapton" },
    { "firstName": "Sergei", "lastName": "Rachmaninoff" }
   ]
  }
  </code></pre>
  
  <ol>
  <li>How to make just one foreach() to
  decode above JSON string?</li>
  <li>How to detect object's names: inbox,
  sent or draft on this foreach()?</li>
  </ol>