Skip to content

Instantly share code, notes, and snippets.

@jonathankowalski
Created February 6, 2013 19:48
Show Gist options
  • Save jonathankowalski/4725233 to your computer and use it in GitHub Desktop.
Save jonathankowalski/4725233 to your computer and use it in GitHub Desktop.
<?php
$j=$a=1;
echo '<ul>';
do{
$a = $a << 1;
$i = ($a-$j)%2;
$class = empty($i)?'e':'o';
echo '<li class="'.$class.'">'.$j.'</li>';
$j++;
} while($j<=10);
echo '</ul>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment