note 45632 deleted from ref.strings by aidan

From: Date: Tue, 28 Sep 2004 12:11:23 +0000
Subject: note 45632 deleted from ref.strings by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77489@lists.php.net to get a copy of this message
Note Submitter: Bruce Boughton ---- Note that: <?php function row_color($row_number) { if((($row_number % 2) == 0)) { // row is an even number $color = '#000000'; } else { // row is an odd number $color = '#ffffff'; } return $color; } ?> can be shortened to: <?php function row_color($row_number) { return ($row_number % 2 == 0) ? '#000' : '#FFF'; } ?>

« previous php.notes (#77489) next »