How to break apart? Each part must have $ pnum number of elements. That is, the output should be:
Array ( [1] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [2] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [3] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [4] => Array ( [0] => 9 [1] => 10) )
That is, if there are 11 elements in the array, and we need parts of 3 elements in each, then it is possible that there are 2 elements in the latter.
$ posts is a general array to be split.
UPD :: KNES: I returned at least some of the text, otherwise the answers lose their meaning. :) Please do not delete the text of the question.