Question: I have an array with 40 elements. I just need to show from array the first set of 10 elements and then show some static row in table. After displaying that static row, I just want to show another set of 10 rows. Like wise I need to show all 40 elements.

Answer: 
You can try `array_slice` <http://php.net/manual/en/function.array-slice.php>
The most efficient way is using the [**modulus**](http://php.net/manual/en/language.operators.arithmetic.php) operator, like so:

```
$tot = count($array);
for($i=0;$i<$tot;$i++) {
   echo $array[$i] . '<br>';
   if(($i+1) % 10 == 0) {
      echo '--- TEN GROUP --- <br>';
   }
}

```

Example output:

```
text_1
text_2
...
text_9
text_10
--- TEN GROUP --- 
text_11
text_12
...
text_19
text_20
--- TEN GROUP --- 
text_21
text_22
...

```