Awful code I’ve written today

$row = $table->tr();

if(!($amIAltOrNot = !$amIAltOrNot))
{
    $row->class = "alt";
}


//  Edit: Much better now
$row = $table->tr();

$row->class = ($amIAltOrNot = !$amIAltOrNot) ? "" : "alt";

This entry was posted on Tuesday, January 29th, 2008 at 12:17 pm and is filed under php, programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply