title: How can I implement dynamic pagination in PHP with this line of code?
body: <p>I want to know how can I make this list inline from 1 to 1000 etc maybe with scroll will do, and base on my ouput the prev and 1 is not included, How can I fix this?</p>
  
  <p><img src="https://i.stack.imgur.com/fcCOo.png" alt="enter image description here"></p>
  
  <p>Here's the code I use:</p>
  
  <pre><code>echo 
          '&lt;div class="pagination"&gt;
              &lt;ul&gt;
                  &lt;li&gt;Prev&lt;/li&gt;';
          if(isset($_SESSION['paging'])){
              $pages=$_SESSION['paging'];
              echo 
                  '&lt;li&gt;'.$pages.'&lt;/li&gt;';
          }
          else{
              echo 
                  '&lt;li&gt;'.$pages.'&lt;/li&gt;';
              $_SESSION['paging']=$pages;
              $_SESSION['paging1']=$pages;
          }
  ?&gt;
          &lt;li&gt;Next&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>