title: php unset using loop
body: <p>why I cant get the result I want with this code?</p>
  <pre><code>for($i=0; $i&lt;count($results); $i++){
                              if($results[$i]-&gt;high == $results[$i]-&gt;open and $results[$i]-&gt;low == $results[$i]-&gt;close and $results[$i]-&gt;vol == 0){
                                  unset($results[$i]);    
                          }
  echo json_encode($results);
  </code></pre>
  <p>why I still get the same result as if the unset inside the loop not working? but if I call the echo inside the loop its work</p>