title: How to make PHP for loop with condition?
body: <p>I am using PHP to create looping with condition, but the result was not like what I want.</p>
  
  <p>Any help you can provide would be great! :)</p>
  
  <pre><code>$cnt = array(
      "08.00","09.00","10.00"
  );
  $time = array(
      "07.00","08.00","09.00","10.00","11.00","12.00","13.00","14.00",
      "15.00","16.00","17.00","18.00","19.00","20.00","21.00","22.00"
  );
  </code></pre>
  
  <p>This is my looping code:</p>
  
  <pre><code>for ($i = 0; $i &lt; 16 ; $i++) {
      for ($j = 0; $j &lt; 3 ; $j++) {
          if ($time[$i] == $cnt[$j]) {
              $button[$i] = 'disable';
          } else {
              $button[$i] = $time[$i];
          }
      }
  }
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>07.00 08.00 09.00 disable 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00
  </code></pre>
  
  <p>And the result i want is:</p>
  
  <pre><code>07.00 disable disable disable 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00
  </code></pre>