I have a function that user can create treeview hierarchy dynamically. So everytime user create a new treeview I got a different set of array one of example is like this. So I after user done creating of treeview then click submit I just directly pass the object property from js to php I can't change the data from js because its plugin vue-jstree so what I'm planning is to change it in php. However, its not fix set of array that I could tell whether its only a 2 forloop
. What logic to remove or Edit all those keys even how deep it is
Array
(
[0] => Array
(
[id] => 0
[text] => Hi-flyer
[value] => Hi-flyer
[icon] => fa fa-user
[opened] => 1
[selected] => 1
[disabled] =>
[loading] =>
[children] => Array
(
[0] => Array
(
[id] => 1
[text] => Cynthia Abanes
[value] => 5710
[icon] => fa fa-user
[opened] => 1
[selected] =>
[disabled] =>
[loading] =>
[children] => Array
(
)
)
[1] => Array
(
[id] => 2
[text] => Ronnie De Guzman
[value] => 5806
[icon] => fa fa-user
[opened] => 1
[selected] =>
[disabled] =>
[loading] =>
[children] => Array
(
)
)
[2] => Array
(
[id] => 3
[text] => Ronnie De Guzman
[value] => 5806
[icon] => fa fa-user
[opened] => 1
[selected] =>
[disabled] =>
[loading] =>
[children] => Array
(
)
)
)
)
)