title: show array index number ospecific ID
body: <p>I have a  array.i am using php.</p>
  
  <p>This is json array</p>
  
  <pre><code>{
  
      "score":[
          {
              "userId":"5",
              "playtime":"1396435708",
              "score":"234"
          },
          {
              "userId":"5",
              "playtime":"1396369254",
              "score":"25"
          },
          {
              "userId":"4",
              "playtime":"1396369056",
              "score":"12"
          },
          {
              "userId":"7",
              "playtime":"1396369246",
              "score":"2"
          },
          {
              "userId":"6",
              "playtime":"1396369240",
              "score":"1"
          }
      ],
      "MyPosition":"2"
  }
  </code></pre>
  
  <p>here myposition shows only 2 for userId=5.</p>
  
  <p>but It will be 1 and 2</p>
  
  <p>I am currently using this code </p>
  
  <pre><code>foreach($leadBoard as $key=&gt;$value) {
      if($value['user_id'] == $userId) {
  
          $myposition=$key+1;
      }
  }
  </code></pre>
  
  <p>How can i show all position</p>