Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 413 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 413 Bytes

Array Partition PHP

Partition an array into multiple arrays using PHP.

Example

Input

$input=[1,2,3,4,5,6,7];
$size=[3,2,2];

Output

Array (
    [0] => Array (
            [0] => 1
            [1] => 2
            [2] => 3
        )
    [1] => Array (
            [0] => 4
            [1] => 5
        )
    [2] => Array (
            [0] => 6
            [1] => 7
        )
)