For expert guidance, foreach can only traverse the first child when traversing a three-dimensional array, which is why?
$val) {
?>
onclick= "Task (
,'
') ' >
%; height:6px; Background: #23bd00; " >
&workcenter_id=
&plan_id=
' "id=" show ">
View
$countParent = $key +1+ $count; $child = 0;
if (Is_array ($val [$key])) foreach ($val [$key] as $v) {//This only executes once
if ($val [' id ']== $v [' parent_id ']) {
$count = $count +1; $child = $child +1;
?>
%; height:6px; Background: #23bd00; " >
}
}}?>
------to solve the idea----------------------
Not particularly clear about your data structure, check if this condition is satisfied
if (Is_array ($val [$key]))
------to solve the idea----------------------
Your outer loop is
foreach ($monitorList as $key = $val)
The condition for entering the inner loop is
if (Is_array ($val [$key]))
There is no output when the condition is not met
------to solve the idea----------------------
if (Is_array ($val)) {//Determines whether the value of $val is an array, and if so, goes to the downlevel traversal
------to solve the idea----------------------
Ought to be
if (Is_array ($val)) Judge if there is a next layer