Re: help with script needed

From: Date: Wed, 07 Mar 2007 16:51:10 +0000
Subject: Re: help with script needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-250010@lists.php.net to get a copy of this message
On 3/7/07, Bruce Gilbert <webguync@gmail.com> wrote:
I have a little script that prints a number out from 1 to 100 [php] <?php for( $i=1; $i<=100; $i++ ) { echo $i; echo "<br>"; } ?> [/php] I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing this? -- ::Bruce::
I've seen that question a lot, what i use is fairly simple if( intval($number / $multiple) == ($number / $multiple ) ) try that Tijnema --
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#250010) next »