Skip to content

Partition an array into multiple arrays using PHP.

License

Notifications You must be signed in to change notification settings

josephjlee/PartitionArrayPHP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
        )
)

About

Partition an array into multiple arrays using PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%