I am very new to php. I am trying to make several slices of an array on a large array. Now this is the section of my code:
$row1 = array_slice($filtered, 0, 22);
$row2 = array_slice($filtered, 22, 22);
$row3 = array_slice($filtered, 44, 22);
$row5 = array_slice($filtered, 66, 22);
$row6 = array_slice($filtered, 88, 22);
$row7 = array_slice($filtered, 110, 22);
$row8 = array_slice($filtered, 132, 22);
$row9 = array_slice($filtered, 154, 22);
$row10 = array_slice($filtered, 176, 22);
Each time the initial position of the slice of the array is 22 more than the previous line. Instead of writing all these lines (total 674), there is an instruction that I can use to automatically advance start position 22 to its end, as well as assign it to a variable, which increases by 1 each time, as an example, Thank you.
source
share