title: PHP parsing a line from within a Json API page
body: <p>I am trying to convert this script over from finding one set of variables eg(playtime_forever) to finding another variable eg(backpack_value)</p>
  
  <pre><code>if (!empty($data-&gt;response-&gt;games)) {
    foreach ($data-&gt;response-&gt;games as $game) {   
      if ($game-&gt;appid == $game_id) { 
        $playtime = $game-&gt;playtime_forever;
        if (($playtime &lt; 5940) &amp;&amp; ($playtime &gt; 1)) {
          $fh = fopen("final.".$timestamp.".txt", 'a') or die("Can't open file");
  ...
  </code></pre>
  
  <p>The page it originally parsed looked like this
  <a href="http://pastebin.com/rnnCsijd" rel="nofollow">http://pastebin.com/rnnCsijd</a></p>
  
  <p>but will now be this. Pulled from here
  <a href="http://backpack.tf/api/IGetUsers/v2/?&amp;steamids=76561197992146126&amp;format=json%27" rel="nofollow">http://backpack.tf/api/IGetUsers/v2/?&amp;steamids=76561197992146126&amp;format=json%27</a>;</p>
  
  <pre><code>{
      "response": {
          "success": 1,
          "current_time": 1369669066,
          "players": {
              "0": {
                  "steamid": "76561197992146126",
                  "success": 1,
                  "backpack_value": 36412.71,
                  "backpack_update": 1369630863,
                  "name": ":HIT: Bobo the Monkey Boy",
                  "notifications": 0
              }
          }
      }
  }
  </code></pre>
  
  <p>A small change but I am unable to make the script do what I want. If you could explain how to go about this and the steps behind it, it would be great. I have been trying for a while but I am unable to finish the script</p>