Re: If value is divisible by 2
| From: | Marius Ursache | Date: | Tue, 30 Apr 2002 08:05:51 +0000 |
| Subject: | Re: If value is divisible by 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95330@lists.php.net to get a copy of this message | ||
if(($i % 2)==0)
{
$bg_color = $bg_color1;
}
else
{
$bg_color = $bg_color2;
}
$i++;
Craig a écrit :
> I am trying to write an if statement that says if the value $foo is
> divisible by 2 then echo "text"
>
> i have tried mod but it isnt recognised
>
> any ideas?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Marius Ursache (3563 || 3494)
\|/ ____ \|/
"@'/ ,. \`@"
/_| \__/ |_\
\__U_/