At 07:02 PM 11/10/01 +0100, Hojtsy Gabor wrote: >Isn't > > array_chunk($array, 2, TRUE); > >the same as > > array_slice($array, 0, 2); > >OK, it is not completely the same, as you >cannot choose "do not preserve keys" while >using array_slice(). Wouldn't it be better to >extend array_slice() with another parameter, >or something like that... > >These functions seem to me nearly the same >(except of key preservation).
No. array_chunk() will split the input array into several sub-arrays depending on the chunk length you specify. Try using array_chunk(array('a', 'b', 'c', 'd', 'e'), 2). -Andrei