note 11484 deleted from function.is-float by jimw
| From: | jimw@php.net | Date: | Thu, 20 Dec 2001 23:38:07 +0000 |
| Subject: | note 11484 deleted from function.is-float by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23585@lists.php.net to get a copy of this message | ||
[Editor's note: Just a comment, testing using integer modulus would be simpler:
$data3 = ($data1 % 2 == 0) ? "even" : "odd" ;
You could even do:
$data3 = (++$data1 % 2 == 0) ? "even" : "odd" ;
which should do be odd, even, odd, even, ... if $data1 has not been initialized (assumed initial
value of zero) ]
More along the lines of the alternating color scheme for tables...
You can also work out something like this...
some_loop
{
$data1 += $data1;
$data2 = $data1 / 2;
$data3 = is_float($data2) == 1 ? "#000000" : "#222222";
}