title: comparing the array values in the foreach loop
body: <p>Hi I have the following php foreach loop, </p>
  
  <pre><code> &lt;?php        
  
    foreach ($row['row'] as $inrow) {                
    $slots_available = $inrow[2];              
    $cal_id = $inrow[3];
    $selenable=true;
  
            ?&gt;
  
          &lt;tr style="width: 100%;background: &lt;?php if($slots_available=='H') echo "rgb(235,235,235)"; else echo 'white'; ?&gt;;" class="tbody_vo_edit"&gt;
  
            &lt;td class="thc_vo tblb" width="200" style="border-left: 1px dotted #CFCFCF;font:11px verdana;color:#17375e;background: &lt;?php if($slots_available=='H') echo "rgb(235,235,235)"; else echo 'white'; ?&gt;;"&gt;&lt;?= $inrow[0] ?&gt;&lt;/td&gt;
  
            &lt;td class="thc_vo tblb" width="210" style="border-left: 1px dotted #CFCFCF;font:11px verdana;color:#17375e;background: &lt;?php if($slots_available=='H') echo "rgb(235,235,235)"; else echo 'white'; ?&gt;;"&gt;&lt;?php if($slots_available=='H') echo ' '; else { echo $inrow[1]; } ?&gt;&lt;/td&gt;
  
            &lt;td class="thc_vo tblb " width="140" style="font:11px verdana;color:#17375e;background: &lt;?php if($slots_available=='H') echo "rgb(235,235,235)"; else echo 'white'; ?&gt;;"&gt;
  
          &lt;div style="float:right;margin-top:-2px;display:&lt;?php if($slots_available=='H') echo "none"; else echo 'block'; ?&gt;"&gt;(&lt;?=$users_occupied?&gt;/&lt;?=$slots_available?&gt;)&lt;/div&gt;
          &lt;/td&gt;
  
          &lt;td class="thc_vo tblb" style="width: 25%;min-width:141px;max-width:141px;padding:5px;background:&lt;?php if($slots_available=='H') echo "rgb(235, 235, 235)"; else echo 'white'; ?&gt;"&gt;&lt;?php if($selenb){?&gt;&lt;input style="display:none;" type="text" value="" class="tblinput"&gt;&lt;?php }?&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php
                }
  
  ?&gt;
  </code></pre>
  
  <p>On execution of this i got a table, in which i would like to compare the values of first  ie.,$inrow[0] value with the second row first  value. And i would like to add another  tag if both the values are different. Can anyone help me how can i compare these values. 
  For example : the table is as follows:</p>
  
  <hr>
  
  <h2>time     |  tasks   |   slots <br></h2>
  
  <h2>05:00 am - 05:55 am |   asdfas | 3 <br></h2>
  
  <h2>05:00 am - 05:55 am |   asdasdfasdf | 4</h2>
  
  <hr>
  
  <p>From this table i want to compare the time values of first row and second row and if both are not equal i would like to add a row in the table between these two rows to say "next time slot" 
  Thanks in advance..</p>