Re: help with script needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



oops, ofcourse whe have the modular :)

On 3/7/07, afan@xxxxxxxx <afan@xxxxxxxx> wrote:

try this
if ($i%5 == 0) echo "foo<br>";

-afan

> 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::
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux