JSON DECODE using PHP <p>I am doing some JSON decodes - I followed this tutorial well explained - <a href="http://webtutsdepot.com/2009/08/31/how-to-read-json-data-with-php/" rel="nofollow">How To Parse JSON With PHP</a></p> <p>and the PHP code, I used </p> <pre><code> &lt;?php $string='{"person":[ { "name":{"first":"John","last":"Adams"}, "age":"40" }, { "name":{"first":"Thomas","last":"Jefferson"}, "age":"35" } ]}'; $json_a=json_decode($string,true); $json_o=json_decode($string); // array method foreach($json_a[person] as $p) { echo ' Name: '.$p[name][first].' '.$p[name][last].' Age: '.$p[age].' '; } // object method foreach($json_o-&gt;person as $p) { echo ' &lt;br/&gt; Name: '.$p-&gt;name-&gt;first.' '.$p-&gt;name-&gt;last.' Age: '.$p-&gt;age.' '; } ?&gt; </code></pre> <p>It is working correctly... But my concern I need only details of Thomas' last name and age. I need to handle this to extract only certain features, not all the objects. </p>