Re: Couple of beginner questions

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

 



Robert Cummings wrote:
On Mon, 2009-01-12 at 16:02 -0500, tedd wrote:
True, css does not allow numeric classes (like sessions). But, I never need them anyway.

As I provided before:

http://webbytedd.com/b/color-rows/

this is my solution for alternating row style.

<tr class="row<?php echo($i++ & 1 );?>">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>

That's just wasteful... Here's better:

<tr class="row<?php echo( $i ^= 1 );?>">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>

Cheers,
Rob.

wtf? that's some freaky bug right there rob..

<?php
for($i=0;$i<10;$i++) {
?>
<tr class="row<?php echo( $i ^= 1 ); ?>">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>
<?php
}
?>

output:
<tr class="row1">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>
<tr class="row3">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>
<tr class="row5">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>
<tr class="row7">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>
<tr class="row9">
    <td >abc</td>
    <td >abc</td>
    <td >abc</td>
</tr>

php 5.2.5 - weird

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux