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>
### Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php)

> 
> It returns the sequence of elements from the array array as specified by the offset and length parameters.
> 
> 
> 

### Example:

```
<?php
    $myArray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40);
    print_r(array_slice($myArray, 0, 10));
    print_r(array_slice($myArray, 10, 10));
    print_r(array_slice($myArray, 20, 10));
    print_r(array_slice($myArray, 30, 10));
?>

```

### Output:

```
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
    [5] => 6
    [6] => 7
    [7] => 8
    [8] => 9
    [9] => 10
)
Array
(
    [0] => 11
    [1] => 12
    [2] => 13
    [3] => 14
    [4] => 15
    [5] => 16
    [6] => 17
    [7] => 18
    [8] => 19
    [9] => 20
)
Array
(
    [0] => 21
    [1] => 22
    [2] => 23
    [3] => 24
    [4] => 25
    [5] => 26
    [6] => 27
    [7] => 28
    [8] => 29
    [9] => 30
)
Array
(
    [0] => 31
    [1] => 32
    [2] => 33
    [3] => 34
    [4] => 35
    [5] => 36
    [6] => 37
    [7] => 38
    [8] => 39
    [9] => 40
)

```

### Fiddle: <http://codepad.viper-7.com/mfzof6>