Re: Re: Table Output Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, that's shorthand.. <?=$color?> is the same as:

<? echo $color ?>

<? is the start tag for a php block, ?> is the end tag.. 

On Monday 14 November 2005 6:26 pm, Jeff Grossman wrote:
> Micah Stevens <micah@xxxxxxxxxxxxxxxxxx> wrote:
> > You don't have to output two rows.. just do this:
> >
> > $color = "red"; // init first color.
> > while ($row = mysql_fetch_assoc($data)) {
> >        if ($color == "red") {
> >                $color = "blue";
> >        } else {
> >                $color = "red";
> >        }
> >        ?>
> >        <tr bgcolor="<?=$color?>"><td>..................</td></tr>
> >
> > <?
> > }
> >
> > -Micah
>
> Great, thanks for the help and information.  May I ask, how does PHP
> know to change the color?  What do the "?"'s do in "<?=$color?>"?
>
> Thanks for the help.
>
> Jeff

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux