Your Location is: Home > Php

Write a php program which prints 8 numbers per page in an order so that cutting is in sequence

From: Ankara View: 3848 M.hussain 
 php

Question

In entrance test, there will be 13944 students. All students would be accommodated in a sports ground with 84 students in each row column. We need to print their roll numbers. The role numbers should be like this 00001 to 13944. To make printing of roll numbers easily and then cutting the roll number we use a machine, which cuts roll number bundles in one go, so that we don’t have to sort them while pasting them on chairs. When the cutter cuts roll numbers of each row in order they already are in order. Write a php program which prints those numbers 8 per page in an order so that cutting is in sequence.print page image `

for ($i=1; $i < 13944; $i+=84) {
    for ($j=$i; $j< 84+$i; $j++) { 
        echo $j . '|';
        }
    echo '<br>';
}

` wrote a code in for loop any ideas to do next.

Best answer

applied this method as well but the end page is posting some extra results <?php $value=array();

$value1=1;
$value2=85;
$value3=169;
$value4=253;
$value5=337;
$value6=421;
$value7=505;
$value8=589;
for ($i=1; $i <= 13499; $i++) {
  echo "<table style='width:100%'>
<tr>
<td>{$value1}</td>
<td>{$value2}</td>
</tr>
<tr>
<td>{$value3}</td>
<td>{$value4}</td>
</tr>
<tr>
<td>{$value5}</td>
<td>{$value6}</td>
</tr>
<tr>
<td>{$value7}</td>
<td>{$value8}</td>
</tr>
</table>";
$value1++;
$value2++;
$value3++;
$value4++;
$value5++;
$value6++;
$value7++;
$value8++;
}
?>