Thread
:
how to avoid multiples of 10?
View Single Post
#
2
(
permalink
)
07-23-2008, 06:24 AM
curtiss
Moderator
Join Date: May 2003
Posts: 1,468
That's what the modulus operator (%) is for. The modulus divides the first number by the second number and returns only the remainder. Therefore, your statement should look like:
PHP Code:
if(
$i
%
10
!==
0
) {
__________________
I hate Internet Explorer! Anyone with me?
curtiss
View Public Profile
Visit curtiss's homepage!
Find all posts by curtiss