Mailinglisten-Archive |
Hi Egon...
Egon Schmid wrote:
>
> Michael Wiechert wrote:
>
> > gibts eine modulo-funktion in php?
>
> %
>
> -Egon
>
wow.. kurz und treffend! hast dir wohl ein beispiel an ulf genommen ;)
hier mal ein kleines beispiel:
es änder die farben der tabellenfelder abwechselnd
print "<table border=1 cellspacing=1 cellpadding=5>";
for ($i = 0; $i < $rownum; $i++)
{ $myrow = mysql_fetch_array($result);
print ("<tr>");
$null_oder_eins = $null_bis_n++ % 2;
for ($j = 0; $j < $fieldnum; $j++)
if ($j >= 0) { // wenn $j > 0, wird die erste zeile weggelassen.
u.s.w.
print "<td bgcolor=$farbe[$null_oder_eins]>";
print "$myrow[$j]";
print "</td>";
}}
print "</tr>";
}
print "</table>";
Ciao, Pascal
php::bar PHP Wiki - Listenarchive