title: Check for a change in variable value in forreach loop
body: <p>So I have a checkbox that sends to a PHP script. Basically, my checkboxes create an array, of course. Seeing it's one of those <code>$var[]</code> ones. </p>
  
  <p>So basically, my array will look like this in code:</p>
  
  <pre><code>$vars = array('12345:0','45678:0','78910:0','3434:1','2345:1');
  
  foreach ($vars as $var) {
      $vinfo = explode(":", $var);
      $vgroup = $vinfo[0];
      $vacct = $vinfo[1];
  
      // Various function calls with those variables. 
  }
  </code></pre>
  
  <p>Now, as you can see. I am splitting for vinfo and vaccount. In my source. I have two accounts (in this example). Some groups belong to 0 and some groups belong to 1. I want to run the function <code>switchAccount("details");</code> whenever there's a change in the <code>$vacct</code> variable in the foreach loop. In this case, it should only switch once (seeing 0 is default). </p>
  
  <p>"Account" (<code>$vacct</code>) switches vary based on the user input in the checkbox. But (usually) always goes up one number. Again, depending on admin input.  </p>