/ Published in: PHP

Use this to add alternating rows in PHP.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$i = 0; // start loop $alt = ($i%2) ? 'even' : 'odd'; // echo the result, etc $i++; // end loop /* usage: - place inside a loop - increment the $i variable at the end of the loop */
Comments
