title: Simple paging from Single Array
body: <p>I am trying to do a paging from single array</p>
  
  <pre><code>$input = Array
          (
              [0] =&gt; 'A',
              [1] =&gt; 'B',
              [2] =&gt; 'C'
              ...
  
          )
  </code></pre>
  
  <p>example <code>$show_per_page=2;</code></p>
  
  <p>in page 1</p>
  
  <pre><code>paging($input,$page, $show_per_page);
  
  $output = Array(
                  [0]=&gt;'A',
                  [1]=&gt;'B'
          );
  </code></pre>
  
  <p>in page 2       </p>
  
  <pre><code>$output = Array(                
                  [2]=&gt;'B'
          );
  </code></pre>
  
  <p>I Know about <code>array_slice</code> but it is not right for this case.Anyone know how to do this?</p>