fork(1) download
  1. <?php
  2.  
  3. $vetor = array(10, 20, 30);
  4. for ($i = 1; $i <= 50; $i++) {
  5. echo '<td class="'.(in_array($i, $vetor) ? 'paint_me_green' : 'paint_me_red').'"></td>';
  6. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_green"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_green"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_green"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td><td class="paint_me_red"></td>