Skip to content

Canvy

Just another WordPress site

Tag: tricks

Split PHP array in X equal number of elements

In PHP you can divide an array into an unknown number of chunks by specifying the number of elements in each chunk. To do this you would use the array_chunk function. But what happens when you don’t know the number of elements and just want to split the array in an X number of elements?… Continue reading Split PHP array in X equal number of elements

Published August 20, 2019
Categorized as Tips & tricks Tagged function, php, tips, tricks
Canvy
Proudly powered by WordPress.