Re: If value is divisible by 2
| From: | Alexander Skwar | Date: | Tue, 30 Apr 2002 12:12:43 +0000 |
| Subject: | Re: If value is divisible by 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95370@lists.php.net to get a copy of this message | ||
»Craig« sagte am 2002-04-30 um 09:00:33 +0100 :
> 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
if ($foo % 2){
echo "foo is divisible by 2";
} else {
echo "it is not";
}
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de | Jabber:
askwar@a-message.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 6 days 7 hours 12 minutes