title: Pagination in reverse order
body: <p>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?</p>
  
  <pre><code>            if($pagination-&gt;total_pages() &gt; 1) {
  
          for($i=1; $i &lt;= $pagination-&gt;total_pages(); $i++){
              if($i == $page){
                  echo " &lt;span class=\"selected_page\"&gt;{$i}&lt;/span&gt; "; 
              }else{
                  echo " &lt;a href=\"index.php?page={$i}\"&gt;{$i}&lt;/a&gt; ";  
              }
          }
      }
  </code></pre>