title: What's the correct way to access a field in an array element with php?
body: <p>I'm getting a few rows from the DB with an ajax call in PHP and I save the result to an array with javascript.<br>
  Then I make some changes in the data and wish to update the DB.<br>
  So I use another ajax call for that but I can't manage to access the fields inside the rows correctly.<br>
  When I try this I get nothing:</p>
  
  <pre><code>echo $bArray[$i].branchId;
  </code></pre>
  
  <p>When I try this:</p>
  
  <pre><code>echo json_encode($bArray[$i].branchId);
  </code></pre>
  
  <p>I get <code>ArraybranchId</code> instead of the field value.</p>
  
  <p>What's the correct way to access the field with php?</p>