WordPress.org

Ready to get started?Download WordPress

Plugin Directory

array_partition

Provides a helper function to split an array into N number of evenly distributed partitions (i.e. split a list into N columns)

Why not use PHP's built-in `array_chunk()`?

array_chunk()

allows you to specify the number of elements per partition, not how many partitions you want. (See Description.).

For an array with 12 elements, if you requested a chunk size of 2, you would get back an array of 6 sub-arrays (the original elements grouped into arrays of 2 elements). With array_partition(), if you requested 2 partitions, you would get back an array of 2 sub-arrays (the original elements grouped into 2 arrays).

Does this plugin include unit tests?

Yes.

Requires: 1.2 or higher
Compatible up to: 4.0
Last Updated: 2014-8-26
Downloads: 664

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
100,1,1