Re: note 11484 added to is_float

From: Date: Thu, 22 Feb 2001 19:09:24 +0000
Subject: Re: note 11484 added to is_float
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-11430@lists.php.net to get a copy of this message
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) Will add that comment to your note. Tnxs for the contribution. --- jaks@tpno.org wrote: > 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"; > } > > http://www.php.net/manual/en/function.is-float.php > > > -- > PHP Notes Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-notes-unsubscribe@lists.php.net > For additional commands, e-mail: > php-notes-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== --- Jesus M. Castagnetto <jmcastagnetto@php.net> __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

« previous php.notes (#11430) next »