Reputation: 105
I need to know if a changing number divides completely by 4. this is the code that I am currently using:
if ($ResultsCounter %4 != 0){
$htmlResult .= "</div><div class='row'>";
}
Problem here is that if the number is greater than 0 it will always divide by 4. I need this to run if the result is a whole number... i.e. 4, 8, 12, 6...
Upvotes: 0
Views: 287
Reputation: 7672
Change from
if ($ResultsCounter %4 != 0){
to
if ($ResultsCounter %4 == 0){
Upvotes: 3