I'm retrieving 4 latest items from the database and show them in a list. My question is that how can I add a different HTML class to the last item?! for example,
<ul>
<li class="list">number 1</li>
<li class="list">number 2</li>
<li class="list">number 3</li>
<li class="list last-child">number 4</li>
</ul>
how can I add last-child to the last item using php?