I experience difficulty in order to sort through arrays. Google a few hours away - surprisingly, did not find anything.
The essence is as follows. There are several arrays of the form:
Array ( [2] => Array ( [n] => 1 [d] => 1 [p] => ) [3] => Array ( [n] => 2 [d] => 2 [p] => ) [4] => Array ( [n] => 3 [d] => 3 [p] => ) [5] => Array ( [n] => 4 [d] => 4 [p] => ) [6] => Array ( [n] => 5 [d] => 5 [p] => ) Array ( [2] => Array ( [n] => 1 [d] => 1 [p] => ) [3] => Array ( [n] => 2 [d] => 2 [p] => ) [4] => Array ( [n] => 3 [d] => 3 [p] => ) [5] => Array ( [n] => 4 [d] => 4 [p] => ) [6] => Array ( [n] => 5 [d] => 5 [p] => ) Array ( [2] => Array ( [n] => 1 [d] => 1 [p] => ) [3] => Array ( [n] => 2 [d] => 2 [p] => ) [4] => Array ( [n] => 3 [d] => 3 [p] => ) [5] => Array ( [n] => 4 [d] => 4 [p] => ) [6] => Array ( [n] => 5 [d] => 5 [p] => ) The key [n] is id.
We need to go through all the variations of id. Get all possible iterations.
1-1-1 1-2-1 1-3-1 1-1-2 1-1-3 1-1-4 2-2-2 ... In other words, to create such an image a maximum of bulkheads, so that later you can already work with other keys, compare them, and generally use :)
I will be glad to any hint :) Thank you!