Jump to content


Photo

if $counter is divisible exactly by 3


  • Please log in to reply
3 replies to this topic

#1 StirCrazy

StirCrazy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 05 July 2006 - 06:51 PM

Wonder if anyone can help me.
What is the correct syntax for the below?

if $counter is divisible exactly by 3 {
?>
    </tr>
<?php

}



Cheers guys,
S.C>

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 July 2006 - 06:52 PM

<?php
if(($counter % 3) == 0)
   echo "</tr>";
?>

Info: PHP Manual


#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 05 July 2006 - 06:53 PM

You'll probably want to use something like this:
if(($counter % 3) == 0)

EDIT: Doh! Me too slow.

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 July 2006 - 06:54 PM

You can call me "Quikfingers McGee".  ;)

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users