So I'm playing around with this PHP tutorial and I kinda got stuck. I have a piece of code for pagination that right now displays pages in ascending order, and I'd like it to display them in descending order, but I can't figure out how to do it. Can someone please help me out?
if($pagination->total_pages() > 1) {
for($i=1; $i <= $pagination->total_pages(); $i++){
if($i == $page){
echo " <span class=\"selected_page\">{$i}</span> ";
}else{
echo " <a href=\"index.php?page={$i}\">{$i}</a> ";
}
}
}