Answer the question
In order to leave comments, you need to log in
How to make a uniform selection from an array?
Good day!
Unable to create an algorithm. There is an array with a certain number of elements. It is necessary to distribute ALL elements of the array into groups, according to N elements, and so that the categories are distributed evenly.
$arr = Array(
"Категория 1" => Array(
"Товар 1",
"Товар 2",
"Товар 3",
...
"Товар 30",
),
"Категория 2" => Array(
"Товар 1",
"Товар 2",
"Товар 3",
...
"Товар 20",
),
"Категория 3" => Array(
"Товар 1",
"Товар 2",
"Товар 3",
...
"Товар 10",
),
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question