How to make a condition?

Tell me, how to make a condition:
i =0, i = 1 - perform
i =2, i = 3 - not performed
i =4, i = 5 - perform

etc.
March 23rd 20 at 18:57
2 answers
March 23rd 20 at 18:59
Solution
if ($i % 4 < 2) {

or

if (!($i & 2)) {
March 23rd 20 at 19:01
<?php
for ($i=0; $i<15; $i++) {
 if (($i/2)%2 === 0) {
 echo $i . ''; // 0 1 4 5 8 9 12 13
}
}

Find more questions by tags PHP