title: PHP Get value from JSON
body: <p>Let's say I have this JSON:</p>
  
  <pre><code>{
    "achievement": [
      {
        "title": "Ready for Work",
        "description": "Sign up and get validated",
        "xp": 50,
        "difficulty": 1,
        "level_req": 1
      },
      {
        "title": "All Around Submitter",
        "description": "Get one piece of textual content approved in all five areas.",
        "xp": 500,
        "difficulty": 2,
        "level_req": 1
      }
  }
  </code></pre>
  
  <p>and I am trying this thru PHP:</p>
  
  <pre><code>$string = file_get_contents("achievements.json");
  $json_a=json_decode($string,true);
  
  $getit = $json_a-&gt;achievement['title'][1];
  </code></pre>
  
  <p>I'm trying to get the first "id" of the achievement.. which would be <code>READY FOR WORK</code>. </p>
  
  <p>How do I fix this?</p>