I want to have an if statement in PHP to calculate if an INT equals only certain numbers. The pattern would go like: 3, 5, 8, 10, 13, 15, 18, 20 etc. It adds 3, then 2, repeating. The pattern is consistent with the last digit (3,5,8,0), but I don't want to include the first 0.
I could do it this way, but it could go on forever...
if($int == 3 || $int == 5 || $int == 8 || $int == 10 ....)
{
//do stuff
}
This way also does multiples of 3...
if ($int % 3 == 0)
{
//do stuff
}
But doesn't do the pattern I want. What's the right way of doing this?