I have a single-dimensional array of categories; some of which are children of other categories, and some of which contain 'elements'. I need to turn it into a multidimensional array, and remove any categories which have no elements in them or any of their children (or children's children...).
I have the following array:
$category_array = array(
1 => array(
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
),
4 => array(
'elementcount' => 0,
'parentcat' => 1,
'depth' => 2
),
8 => array(
'elementcount' => 0,
'parentcat' => 4,
'depth' => 3
),
9 => array(
'elementcount' => 2,
'parentcat' => 4,
'depth' => 3
),
11 => array(
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
),
12 => array(
'elementcount' => 0,
'parentcat' => 11,
'depth' => 2
),
21 => array(
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
)
);
and I need the following array:
$multidimensional_array = array(
1 => array(
'elementcount' => 3,
'children' => array(
4 => array(
'elementcount' => 0,
'children' => array(
9 => array(
'elementcount' => 2
)
)
)
)
),
11 => array(
'elementcount' => 3,
),
21 => array(
'elementcount' => 3,
)
);
How can this be achieved?
This would be an approach:
<?php
$input = [
1 => [
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
],
4 => [
'elementcount' => 0,
'parentcat' => 1,
'depth' => 2
],
8 => [
'elementcount' => 0,
'parentcat' => 4,
'depth' => 3
],
9 => [
'elementcount' => 2,
'parentcat' => 4,
'depth' => 3
],
11 => [
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
],
12 => [
'elementcount' => 0,
'parentcat' => 11,
'depth' => 2
],
21 => [
'elementcount' => 3,
'parentcat' => 0,
'depth' => 1
]
];
$maxDepth = max(array_column($input, 'depth'));
// handle elements from higher to lower depth
for ($d = $maxDepth; $d >= 0; $d--) {
array_walk($input, function(&$entry, $index) use (&$input, $d) {
if (isset($entry['depth']) && $entry['depth'] == $d) {
// omit entries without elements or elements in children
if ($entry['elementcount'] < 1 && empty($entry['children'])) {
unset($input[$index]);
// handle as child entry of a parent entry
} else if (array_key_exists($entry['parentcat'], $input)) {
$input[$entry['parentcat']]['children'][$index] = [
'elementcount' => $entry['elementcount'],
'children' => isset($entry['children']) ? $entry['children'] : []
];
unset($input[$index]);
// handle as ordinary entry
} else {
$input[$index] = [
'elementcount' => $entry['elementcount'],
'children' => isset($entry['children']) ? $entry['children'] : []
];
}
}
});
}
print_r($input);
The strategy:
handle higher depths first so that the order of input elements does not matter
for each element check if the parent exists, if so stuff it in there
redefine all handled elements
The obvious output is:
(
[1] => Array
(
[elementcount] => 3
[children] => Array
(
[4] => Array
(
[elementcount] => 0
[children] => Array
(
[9] => Array
(
[elementcount] => 2
[children] => Array
(
)
)
)
)
)
)
[11] => Array
(
[elementcount] => 3
[children] => Array
(
)
)
[21] => Array
(
[elementcount] => 3
[children] => Array
(
)
)
)
I took the liberty to create a slightly modified result compared to your suggestion:
The 'children' property always exists as an array. That makes the usage of the result easier and more robust later on. I'd say that in general all elements inside a structure should have identical structure themselves if possible ...
function isParent($id, $list) : bool {
foreach($list as $item) {
if ($item['parentcat'] === $id) {
return true;
}
}
return false;
}
function buildLevel($parent, $catsByParent) : array {
$result = $catsByParent[$parent] ?? [];
foreach($result as $id => $cat) {
if (isset($catsByParent[$id])) {
$result[$id]['children'] = buildLevel($id, $catsByParent);
unset($catsByParent[$id]);
}
}
return $result;
}
// Filter out empty categories
$cats = array_filter(
$category_array,
function($cat, $id) use($category_array) {
return $cat['elementcount']>0 || isParent($id, $category_array);
},
ARRAY_FILTER_USE_BOTH
);
$catsByParent = [];
// Build cats list keyed by parentcat
foreach($cats as $id => $cat) {
$parent = $cat['parentcat'];
unset($cat['parentcat'], $cat['depth']);
$catsByParent[$parent] = ($catsByParent[$parent] ?? []) + [$id => $cat];
}
// Build result
$multidimensional_array = buildLevel(0, $catsByParent);
print_r($multidimensional_array);
First one filters out empty elements, i.e "categories which have no elements in them or any of their children". (children's children requirement sounds strange, wouldn't that be "any of their children" one level further down?)
Then the remaining categories are grouped/sorted by parentcat, aka "level id", to make the list workable :).
Then that list is traversed, starting with level id 0 at the top, and recursively processed(the children) as deep down as needed.
Related
This is my array:
$arr = array(
0 => array(
'title' => 'test1',
'count' => 4,
'month' => 'jan-2015'
),
1 => array(
'title' => 'test2',
'count' => 10,
'month' => 'jan-2015'
),
2 => array(
'title' => 'test3',
'count' => 14,
'month' => 'jun-2015'
),
3 => array(
'title' => 'test4',
'count' => 45,
'month' => 'july-2015'
),
);
I've to convert this array into multi-dimentional array as below:
$arr = array(
'jan-2015' => array(
0 => array(
'title' => 'test1',
'count' => 4,
),
1 => array(
'title' => 'test2',
'count' => 10,
),
),
'jun-2015' => array(
0 => array(
'title' => 'test3',
'count' => 14,
),
),
'july-2015' => array(
0 => array(
'title' => 'test4',
'count' => 45,
),
),
);
I've tried to make it as expected but unfortunately i can't make this.
Is any other solutions for this?
According to your data structure :
$arr = array(
0 => array(
'title' => 'test1',
'count' => 4,
'month' => 'jan-2015'
),
1 => array(
'title' => 'test2',
'count' => 10,
'month' => 'jan-2015'
),
2 => array(
'title' => 'test3',
'count' => 14,
'month' => 'jun-2015'
),
3 => array(
'title' => 'test4',
'count' => 45,
'month' => 'july-2015'
),
);
try this:
$newArray = array();
foreach($arr as $key => $val) {
$newArray[$val['month']][] = $val;
}
echo '<pre>'.print_r($newArray,1).'</pre>';
Output:
Array
(
[jan-2015] => Array
(
[0] => Array
(
[title] => test1
[count] => 4
[month] => jan-2015
)
[1] => Array
(
[title] => test2
[count] => 10
[month] => jan-2015
)
)
[jun-2015] => Array
(
[0] => Array
(
[title] => test3
[count] => 14
[month] => jun-2015
)
)
[july-2015] => Array
(
[0] => Array
(
[title] => test4
[count] => 45
[month] => july-2015
)
)
)
You could use this function:
function transform($input) {
// Extract months, and use them as keys, with value set to empty array
// The array_fill_keys also removes duilicates
$output = array_fill_keys(array_column($input, 'month'), array());
foreach ($input as $element) {
$copy = $element;
// remove the month key
unset($copy["month"]);
// assign this to the month key in the output
$output[$element["month"]][] = $copy;
}
return $output;
}
Call it like this:
$arr = array(
0 => array(
'title' => 'test1',
'count' => 4,
'month' => 'jan-2015'
),
1 => array(
'title' => 'test2',
'count' => 10,
'month' => 'jan-2015'
),
2 => array(
'title' => 'test3',
'count' => 14,
'month' => 'jun-2015'
),
3 => array(
'title' => 'test4',
'count' => 45,
'month' => 'july-2015'
),
);
print_r (transform($arr));
Output:
Array
(
[jan-2015] => Array
(
[0] => Array
(
[title] => test1
[count] => 4
)
[1] => Array
(
[title] => test2
[count] => 10
)
)
[jun-2015] => Array
(
[0] => Array
(
[title] => test3
[count] => 14
)
)
[july-2015] => Array
(
[0] => Array
(
[title] => test4
[count] => 45
)
)
)
By using answer of #Girish Patidar, You can achieve this by:
$outputArr = array();
$to_skip = array();
foreach($arr as $row){
$to_skip = $row;
unset($to_skip['month']);
$outputArr[$row['month']][] = $to_skip;
}
echo "<pre>";
print_r($outputArr);
die;
There could many way to do this. Please try this one if it works for you
<?php
$newArr=NULL;
foreach($arr as $array)
{
$temp=NULL;
$temp['title']=$array['title'];
$temp['count']=$array['count'];
$newArr[$array['month']][]=$temp;
}
var_dump($newArr);
?>
This is my array:
Array (
[0] => Array ( [SocketID] => 1 [SocketName] => Name [SocketDecimal] => 0 [SocketHex] => 00 [SocketAtt] => 1 [Category] => 1 [Value] => 100 [Procentage] => 0 )
[1] => Array ( [SocketID] => 2 [SocketName] => Name2 [SocketDecimal] => 50 [SocketHex] => 32 [SocketAtt] => 1 [Category] => 1 [Value] => 800 [Procentage] => 0 )
[2] => Array ( [SocketID] => 3 [SocketName] => Name3 [SocketDecimal] => 100 [SocketHex] => 64 [SocketAtt] => 1 [Category] => 1 [Value] => 60 [Procentage] => 0 )
)
How can I extract a row by SocketDecimal?
For example: I want to extract row where SocketDecimal = 50 and make new an array only with that row.
foreach($array as $entry) {
if($entry['SocketDecimal'] == 50)
$newArr[] = $entry;
}
$newArr will contain the desired "row". Of course you can manipulate the if-statement depending on which "row" (I'd just call it array entry) you want to extract.
It's not the best way for big data! It's easy for deep multiarrays.
$arr = array(
array('socket_id'=>1,'name'=>'test1'),
array('socket_id'=>2,'name'=>'test2'),
array('socket_id'=>3,'name'=>'test3'),
array('socket_id'=>2,'name'=>'test4')
);
$newArr = array();
foreach($arr as $row){
foreach($row as $key=>$r){
if($key == 'socket_id' && $r==2)
$newArr[] = $row;
}
}
print_r($newArr);
$result = array();
foreach($input as $i){
if($i['SocketDecimal']==50)
$result[]=$i;
}
You can do it by this method
foreach ($yourarray as $key => $value){
$newarray = array("SocketDecimal"=>$value["SocketDecimal"];
}
print_r($newarray);
If your result array is like given below
$arr = array(
array( 'SocketID' => 1, 'SocketName' => 'Name', 'SocketDecimal' => 0, 'SocketHex' => 0, 'SocketAtt' => 1, 'Category' => 1, 'Value' => 100, 'Procentage' => 0 ),
array ( 'SocketID' => 2, 'SocketName' => 'Name2', 'SocketDecimal' => 50, 'SocketHex' => 32, 'SocketAtt' => 1, 'Category' => 1, 'Value' => 800, 'Procentage' => 0 ),
array ( 'SocketID' => 3, 'SocketName' => 'Name3', 'SocketDecimal' => 100, 'SocketHex' => 64, 'SocketAtt' => 1, 'Category' => 1, 'Value' => 60, 'Procentage' => 0 )
);
print_r($arr);
Get row for SocketDecimal=50 by following loop:
<pre>
$resultArr = '';
foreach($arr as $recordSet)
{
if($recordSet['SocketDecimal'] == 50)
{
$resultArr[] = $recordSet;
break;
}
}
</pre>
print_r($resultArr);
break foreach loop so that it will not traverse for all the array when SocketDecimal(50) founded.
You can use array_column + array_search combo
$array = Array (
"0" => Array ( "SocketID" => 1, "SocketName" => "Name", "SocketDecimal" => 0, "SocketHex" => 00, "SocketAtt" => 1, "Category" => 1, "Value" => 100, "Procentage" => 0 ) ,
"1" => Array ( "SocketID" => 2, "SocketName" => "Name2", "SocketDecimal" => 50, "SocketHex" => 32, "SocketAtt" => 1, "Category" => 1, "Value" => 800, "Procentage" => 0 ),
"2" => Array ( "SocketID" => 3, "SocketName" => "Name3", "SocketDecimal" => 100, "SocketHex" => 64, "SocketAtt" => 1, "Category" => 1, "Value" => 60 ,"Procentage" => 0 )
);
var_dump($array[array_search(50,array_column($array,'SocketDecimal'))]);
I am new to php and i want to remove element from array Here is my array:
Array
(
[Total] => 21600000
[Items] => Array
(
[2-13] => Array
(
[Item] => 2
[PID] => 13
[UPrice] => 11000000
[Qty] => 1
[Total] => 11000000
)
[58-167] => Array
(
[Item] => 58
[PID] => 167
[UPrice] => 5300000
[Qty] => 1
[Total] => 5300000
)
)
)
And i want to remove array element by PID.
I have try this but no luck:-
$ShoppingBag =$_SESSION['ssss'];
if ($ShoppingBag !== null && $ShoppingBag['Total'] > 0) {
foreach ($ShoppingBag['Items'] as $IOrder) {
if($IOrder["PID"]==13)
{
unset($ShoppingBag[$IOrder]);
}else
{
}
}
}
Please help. Thanks
You can try with one simple array map :)
$arr = [
'Total' => 21600000,
'Items' => [
'2-13' => [
'Item' => 2,
'PID' => 13,
'UPrice' => 11000000,
'Qty' => 1,
'Total' => 11000000
],
'58-167'=> [
'Item' => 58,
'PID' => 167,
'UPrice' => 5300000,
'Qty' => 1,
'Total' => 5300000
]
]
];
$test = array_map(function($ar) {
foreach($ar as $k=>$i) {
if( isset($i['PID']) && $i['PID'] == '13')
unset($ar[$k]);
}
return $ar; } , $arr);
var_dump($test);
You need 2 loop to do the action you want.
foreach($my_array as $key=>$value)
{
if(is_array($value))
{
foreach($value as $k=>$v)
{
if($k == 'PID')
{
unset($value[$k]);
}
}
}
}
with this you can remove only element with key PID.
Hi youre unsetting the $IOrder instead of the Item that you want to delete:
This code is a solution an i tested it :
$ShoppingBag = Array
(
"Total" => 21600000,
"Items" => Array
(
"2-13" => Array
(
"Item" => 2,
"PID" => 13,
"UPrice" => 11000000,
"Qty" => 1,
"Total" => 11000000,
),
"58-167" => Array
(
"Item" => 58,
"PID" => 167,
"UPrice" => 5300000,
"Qty" => 1,
"Total" => 5300000,
),
),
);
foreach($ShoppingBag["Items"] as $key => $value){
if($value["PID"]==13){
unset($ShoppingBag["Items"][$key]);
}
}
You should know that always when you're using foreach loop the foreach( $a as $b ) when you do something to $b , $a remains the same because tey are different variables :)
Hope it will help you .
Regards.
$arr = [
'Total' => 21600000,
'Items' => [
'2-13' => [
'Item' => 2,
'PID' => 13,
'UPrice' => 11000000,
'Qty' => 1,
'Total' => 11000000
],
'58-167'=> [
'Item' => 58,
'PID' => 167,
'UPrice' => 5300000,
'Qty' => 1,
'Total' => 5300000
]
]
];
$pid_to_remove = 13;
$new_ar = array_filter(
$arr,
function ($v) using ($pid_to_remove) {
return (!isset($v['PID'])) || ($v['PID'] != $pid_to_remove);
}
);
With a table on my database that stores items of a menu, where every item has an ID, a NAME, and a FATHER ID, I need to arrange it and get a tree-like structure of multiple levels. What I need is an array with the top level menus, then every element with his 'childs' array that contains the sub menus, and this sub menus with their 'childs' array containing their respective sub sub menus an so for. English is no my native language so bear with me :)
An example for better understanding.
I have the following menu in array form:
1- System
2- Profile
3- Account
4- Info
5- Security
6- Logout
With the following array:
$array = array(
array('id' => 1, 'item'=>'System', 'id_father' => null),
array('id' => 2, 'item'=>'Profile', 'id_father' => 1),
array('id' => 3, 'item'=>'Account', 'id_father' => 2),
array('id' => 4, 'item'=>'Info', 'id_father' => 3),
array('id' => 5, 'item'=>'Security', 'id_father' => 3),
array('id' => 6, 'item'=>'Logout', 'id_father' => 1)
);
How can I get the following ? :
array(
array('id' => 1, 'item'=>'System', 'id_father' => null,
'childs' => array(
array('id' => 2, 'item'=>'Profile', 'id_father' => 1),
array('id' => 3, 'item'=>'Account', 'id_father' => 2,
'childs' => array(
array('id' => 4, 'item'=>'Info', 'id_father' => 3),
array('id' => 5, 'item'=>'Security', 'id_father' => 3)
),
),
),
),
array('id' => 6, 'item'=>'Logout', 'id_father' => 1)
);
Change $array to :
$array = array(
array('id' => 1, 'item'=>'System', 'id_father' => null),
array('id' => 2, 'item'=>'Profile', 'id_father' => 1),
array('id' => 3, 'item'=>'Account', 'id_father' => 1), // set id_father = 1
array('id' => 4, 'item'=>'Info', 'id_father' => 3),
array('id' => 5, 'item'=>'Security', 'id_father' => 3),
array('id' => 6, 'item'=>'Logout', 'id_father' => null) // edited to set id_father = null
);
Do it:
function tree( $ar, $pid = null ) {
$op = array();
foreach( $ar as $item ) {
if( $item['id_father'] == $pid ) {
$op[$item['id']] = array(
'item' => $item['item'],
'id_father' => $item['id_father'],
'id' => $item['id']
);
// using recursion
$children = tree( $ar, $item['id'] );
if( $children ) {
$op[$item['id']]['childs'] = $children;
}
}
}
return $op;
}
$tree = tree($array);
echo '<pre>';
print_r( $tree);
echo '</pre>';
// OUTPUT
Array
(
[1] => Array
(
[item] => System
[id_father] =>
[id] => 1
[childs] => Array
(
[2] => Array
(
[item] => Profile
[id_father] => 1
[id] => 2
)
[3] => Array
(
[item] => Account
[id_father] => 1
[id] => 3
[childs] => Array
(
[4] => Array
(
[item] => Info
[id_father] => 3
[id] => 4
)
[5] => Array
(
[item] => Security
[id_father] => 3
[id] => 5
)
)
)
)
)
[6] => Array
(
[item] => Logout
[id_father] =>
[id] => 6
)
)
There is no need to recursion in this way :
$pool = array();
foreach ($array as $value) {
$pool[$value['id']] = $value;
$pool[$value['id']]['children'] = array();
}
foreach ($pool as $k => $v) {
if ($v['id_father']) {
$pool[$v['id_father']]['children'][] = &$pool[$k];
}
else
$parent[] = $v['id'];
}
$result = array();
foreach ($parent as $val) {
$result = $result + $pool[$val];
}
print_r($result);
I am terribly stuck. I think I need to write a recursive method but I can't work out how...!
I am trying to convert an array of parent-child relationships into a hierarchical tree which I will later display to a user.
This is an example of the input data I might have:
$input = array(
array(
'itemGroupID' => 1,
'childItemGroupID' => 2
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 3
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 4
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 212
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 339
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 336
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 6
),
array(
'itemGroupID' => 1,
'childItemGroupID' => 5
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 8
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 9
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 10
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 11
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 12
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 13
),
array(
'itemGroupID' => 6,
'childItemGroupID' => 74
),
array(
'itemGroupID' => 9,
'childItemGroupID' => 15
),
array(
'itemGroupID' => 10,
'childItemGroupID' => 16
),
array(
'itemGroupID' => 11,
'childItemGroupID' => 17
),
array(
'itemGroupID' => 12,
'childItemGroupID' => 18
),
array(
'itemGroupID' => 13,
'childItemGroupID' => 19
),
array(
'itemGroupID' => 74,
'childItemGroupID' => 75
)
);
I wish to get back data in a format like:
$output = array(
array(
'itemGroupID' => 1,
'children' => array(
array(
'itemGroupID' => 2
),
array(
'itemGroupID' => 3
),
array(
'itemGroupID' => 4
),
array(
'itemGroupID' => 212
),
array(
'itemGroupID' => 339
),
array(
'itemGroupID' => 336
),
array(
'itemGroupID' => 6,
'children' => array(
array(
'itemGroupID' => 8
),
array(
'itemGroupID' => 9,
'children' => array(
array(
'itemGroupID' => 15
)
)
),
array(
'itemGroupID' => 10,
'children' => array(
array(
'itemGroupID' => 16
)
)
),
array(
'itemGroupID' => 11,
'children' => array(
array(
'itemGroupID' => 17
)
)
),
array(
'itemGroupID' => 12,
'children' => array(
array(
'itemGroupID' => 18
)
)
),
array(
'itemGroupID' => 13,
'children' => array(
array(
'itemGroupID' => 19
)
)
),
array(
'itemGroupID' => 74,
'children' => array(
array(
'itemGroupID' => 75
)
)
)
)
),
array(
'itemGroupID' => 5
)
)
)
);
I managed to write some code which would tell me the root(s) to start from. (As I was worried that if you were recursing from the first node it might turn out that this is from half-way down the chain already...)
Btw, the element I output can be used to get the starting index, for each hierarchical chain.
private function _arraySearch($arr, $callback)
{
foreach ($arr as $key => $item) {
if ($callback($item)) {
return $key;
}
}
return false;
}
private function _findRootsOfItemGroupTree($activeItemGroupChildren)
{
$searchArray = $activeItemGroupChildren;
$roots = array();
foreach ($activeItemGroupChildren as $itemGroupChild) {
$parentItemGroupID = $itemGroupChild['itemGroupID'];
$found = array_filter($searchArray, function ($element) use ($parentItemGroupID) {
return $element['childItemGroupID'] == $parentItemGroupID;
});
$rootItemGroupID = $parentItemGroupID;
if (count($found) == 0
&& $this->_arraySearch($roots,
function ($element) use ($rootItemGroupID) {
return $element['itemGroupID'] == $rootItemGroupID;
}) === false) {
$roots[] = $itemGroupChild;
}
}
return $roots;
}
However, I now need to use this information to create a new associative array. I can't work out how. (I will post some workings in a couple of minutes..)
Ideas?
note: assume there are no recursive loops in this structure even though they could technically exist.
If I understand your problem correctly, this should work.
Notice how I call the orderMe function inside the function to make it recursive.
function orderMe($input, $parentId)
{
$return = array($parentId => array('itemGroupID' => $parentId));
$childs = array();
foreach ($input as $i)
{
if ($i['itemGroupID'] == $parentId)
{
$return[$i['itemGroupID']]['children'][$i['childItemGroupID']] = array('itemGroupID' => $i['childItemGroupID']);
$childs[] = $i['childItemGroupID'];
}
if (in_array($i['childItemGroupID'], $childs))
{
$allChilds = orderMe($input, $i['childItemGroupID']);
if (!empty($allChilds[$i['childItemGroupID']]['children']))
$return[$i['itemGroupID']]['children'][$i['childItemGroupID']] = $allChilds;
}
}
return $return;
}
print_r(orderMe($input, 1));
Outputs:
array (
1 =>
array (
'itemGroupID' => 1,
'children' =>
array (
2 =>
array (
'itemGroupID' => 2,
),
3 =>
array (
'itemGroupID' => 3,
),
4 =>
array (
'itemGroupID' => 4,
),
212 =>
array (
'itemGroupID' => 212,
),
339 =>
array (
'itemGroupID' => 339,
),
336 =>
array (
'itemGroupID' => 336,
),
6 =>
array (
6 =>
array (
'itemGroupID' => 6,
'children' =>
array (
8 =>
array (
'itemGroupID' => 8,
),
9 =>
array (
9 =>
array (
'itemGroupID' => 9,
'children' =>
array (
15 =>
array (
'itemGroupID' => 15,
),
),
),
),
10 =>
array (
10 =>
array (
'itemGroupID' => 10,
'children' =>
array (
16 =>
array (
'itemGroupID' => 16,
),
),
),
),
11 =>
array (
11 =>
array (
'itemGroupID' => 11,
'children' =>
array (
17 =>
array (
'itemGroupID' => 17,
),
),
),
),
12 =>
array (
12 =>
array (
'itemGroupID' => 12,
'children' =>
array (
18 =>
array (
'itemGroupID' => 18,
),
),
),
),
13 =>
array (
13 =>
array (
'itemGroupID' => 13,
'children' =>
array (
19 =>
array (
'itemGroupID' => 19,
),
),
),
),
74 =>
array (
74 =>
array (
'itemGroupID' => 74,
'children' =>
array (
75 =>
array (
'itemGroupID' => 75,
),
),
),
),
),
),
),
5 =>
array (
'itemGroupID' => 5,
),
),
),
)