title: Is there a php function to determine whether an array element has changed?
body: <p>Within a foreach statement i want to see if a certain array element has changed or not.  If not, increment my counter.  If so, set back to one.  Is there an easy way to do this?   something like...</p>
  
  <pre><code>$position = 1; 
  
  foreach( $rowDatas as $row )
  {
      //insert $row into db;
  
      if( ! hasChanged($row[0]) )
      {
          $position = $postion + 1;
      } 
      else 
      { 
          $position = 1;
      }
  }
  </code></pre>