PHP array_chunk Example

vincentmic

New member
I am using PHP to write a program and the function array_chunk is not working for me . This function is used to split an array into two and the format of this function is array array_chunk ( array $input , int $size [, bool $preserve_keys = false ] ) .

When i try t use this function i am passing array as a first parameter and entering an integer as a second parameter but its not giving me the result i am expecting or i think i should get. Please can some body create a very small script for me and paste it here which shows the example of using PHP function array_chunk . Please also write the out put of the function with the example code you paste here.
 
The first parameter you have to pass to PHP function array_chunk is the actual array which you want to make chunks or small pieces of. The second parameter of this PHP function is the size each chunk would be and we would be passing a number in this parameter.
 
It's unlikely that anyone will assemble code for you for free just to explain a concept :rolleyes: but I guess it doesn't hurt to ask.

That being said I wouldn't mind knowing the answer to this myself. It's something I've been struggling with and I'm not making a lot of progress doing what I'm doing now.

I guess that makes me a hypocrite, ha ha. Oh well.
 
Back
Top