title: Getting only values that are not the same as the values in an array
body: <p>I am trying to run a for loop that checks for all the values in an array then run an if statement if any any value matches one that is in the array, it skips that value.
  I have this:</p>
  <p>Total Seats</p>
  <pre><code> 10
  </code></pre>
  <pre><code>$seats_arr = [1, 4, 7]
  </code></pre>
  <pre><code>$result = mysqli_query($con, &quot;SELECT * FROM trains WHERE id='$id'&quot;);
  
  while ($row = mysqli_fetch_array($result)) {
      $total_seats = $row['seats'];
      $booked_seats = $row['booked_seats'];
      $viti = $row['viti'];
           
      $seats_arr = preg_split(&quot;/\,/&quot;, $viti);
      print_r($seats_arr);
                      
      ?&gt;
      
      &lt;select class=&quot;custom-select col-12&quot; name=&quot;selected_seat&quot;&gt;
          &lt;option selected=&quot;&quot; disabled&gt;Choose your seat&lt;/option&gt;
          &lt;?php
           $N = $total_seats;
           foreach ($seats_arr as $seat) {            
           for($i=1; $i &lt;= $N; $i++) {
                       
              if($i == $seat){
                  continue;
               }
                        
           ?&gt;
           &lt;option value=&quot;&lt;?php echo $i; ?&gt;&quot;&gt;&lt;?php echo &quot;Seat &quot;, $i; ?&gt;&lt;/option&gt;
            &lt;?php
                 } 
               }
             }
           ?&gt;
       &lt;/select&gt;
  </code></pre>
  <p>Desired Output</p>
  <pre><code>2, 3, 5, 6, 8, 9, 10
  </code></pre>