note 30500 added to function.pow
| From: | martin at NOSPAM dot siebenstaedt dot com | Date: | Thu, 20 Mar 2003 13:05:34 +0000 |
| Subject: | note 30500 added to function.pow | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45544@lists.php.net to get a copy of this message | ||
if you are making lists with alternating colors each line you can use
this:
$color=array("xxxxxx","","yyyyyy");
{
....
echo"<tr bgcolor=".$color[1+pow(-1,++$x)].">.....</tr>";
....
}
instead of:
{
....
if(++$i%2) then $color=xxxxxx;
else $color=yyyyyy;
echo "<tr bgcolor=".$color.">..................</tr>";
....
}
--
http://www.php.net/manual/en/function.pow.php
http://master.php.net/manage/user-notes.php?action=edit+30500
http://master.php.net/manage/user-notes.php?action=delete+30500
http://master.php.net/manage/user-notes.php?action=reject+30500