title: How to make a loop display each 14 lines but in order of pages?
body: <p>I have a txt file with 119 numbers &quot;7****&quot;,
  what I do is to read them from beginning to end:</p>
  <pre><code>for($i = 119; $i &gt;= 0; $i--){
  </code></pre>
  <p>In addition, I have to count every 14 lines.</p>
  <p>Result:</p>
  <pre><code>28
  72844
  72845
  72846
  72847
  72848
  72997
  72998
  73000
  73001
  73002
  73003
  73004
  73005
  73006
  14
  73007
  73083
  73114
  73123
  73148
  73149
  73150
  73151
  73152
  73188
  73192
  73193
  73194
  73195
  0
  </code></pre>
  <p>with another loop inside:</p>
  <pre><code>if( $i % 14 === 0 ){
  </code></pre>
  <p>what I want to do is that instead of displaying 0 14 28, the loop will display 1 2 3 (type of pages):</p>
  <pre><code>2
  72844
  72845
  72846
  72847
  72848
  72997
  72998
  73000
  73001
  73002
  73003
  73004
  73005
  73006
  1
  73007
  73083
  73114
  73123
  73148
  73149
  73150
  73151
  73152
  73188
  73192
  73193
  73194
  73195
  0
  </code></pre>
  <p>My code:</p>
  <pre><code>for($i = 119; $i &gt;= 0; $i--){
  
  $lines = file(&quot;lines.txt&quot;);
  $line = $lines[&quot;$i&quot;];
  echo &quot;$line&lt;br&gt;&quot;;
  
  if( $i % 14 === 0 ){
  echo &quot;$i&lt;br&gt;&quot;;
  }
  
  }
  </code></pre>