title: Php : How to add odd/even loop to my unordered list
body: <p>Here an example my wordpress post. I want to add some class to <strong>the last</strong> of <code>&lt;li&gt;</code></p>
  
  <p>something like <strong><code>&lt;li class='lastli'&gt;</code></strong></p>
  
  <pre><code>&lt;ul class="tabs"&gt;
   &lt;?php
    global $post;
    $myposts = get_posts('numberposts=3');
    foreach($myposts as $post) :
    setup_postdata($post);
    ?&gt;
   &lt;li&gt;&lt;a href="#"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
   &lt;?php endforeach; ?&gt;         
  &lt;/ul&gt;
  </code></pre>
  
  <p>The results I wanted to be like :</p>
  
  <pre><code>&lt;ul&gt;
   &lt;li&gt;Title 1&lt;/li&gt;
   &lt;li&gt;Title 1&lt;/li&gt;
   &lt;li class='lastli'&gt;Title 1&lt;/li&gt;
  &lt;ul&gt;
  </code></pre>
  
  <p>Any last of unordered lists will be <code>&lt;li class='lastli'&gt;</code>. Let me know how to do that?</p>