RE: [PHP] Anyway of knowing whether a integer is odd or even
| From: | Dave Watkinson | Date: | Tue, 09 Oct 2001 13:29:44 +0000 |
| Subject: | RE: [PHP] Anyway of knowing whether a integer is odd or even | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70463@lists.php.net to get a copy of this message | ||
if ($number_of_rows%2 == 0) {
// number of rows is even
} else {
// it's odd
}
regards
Dave
-----Original Message-----
From: Sam [mailto:Sam@dragoman.co.uk]
Sent: 09 October 2001 14:31
To: 'php'
Subject: [PHP] Anyway of knowing whether a integer is odd or even
Hi all,
I have a query which returns X amount of rows.
I would like to display even rows one colour and odd rows a different
colour.
Is there a way to do this?
Thanks in advance,
Sam Rose
p.s. Also I'm only on the digest, so if you could reply directly to me
as
well, that would be a bonus.