if (substr($i,-1)) { echo "Im not a multiple of 10"; } else { echo "I am"; } Should work - basically testing of a 0 as the last digit - anything else will hit the if - the 0 will hit the else let me know fi that works