title: Count JSON objects
body: <p>I have the following php code to return some values from a JSON formated feed.</p>
  
  <pre><code>$json = file_get_contents("//URL HERE");
  $data = json_decode($json, true);
  
  foreach($data['users'] as $item)
  {
    print $item['userName'];
    print ': ';
    print $item['status'];
    print ' - location: ';
    print $item['location']['y'];
    print ' / ';
    print $item['location']['x'];
    print '&lt;br&gt;';
  }
  </code></pre>
  
  <p>This code returns me the name of the user with the status and it's location.
  At the end of the users I want to count them.</p>
  
  <p>the feed has the following format:</p>
  
  <pre><code>{
   "startTime":"time",
   "users":
   [
   {
    "location": {
      "y": 47.61,
      "x": 21.52
    },
    "status": 48,
    "userName": "testuser",
  },
  {
    "location": {
      "y": 48.01,
      "x": 20.88
    },
    "status": 49,
    "userName": "testuser18",
  }
  ],
    "startTime1": 1314,
    "endTime1": "141414"
  }
  </code></pre>
  
  <p>I've tried to use the following code:</p>
  
  <pre><code>$iCount = count($data);  //returns value 4
  $iCount1 = count($item); //returns value 3
  print $iCount;
  </code></pre>
  
  <p>But I need to count how many users are. Basically to count how many times "users" object appears in the feed. </p>