Invalid argument supplied for foreach
I have got this warning, have someone an idea:
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\testplanning\modules\planning\planning.module on line 425.
The code where he the fall is:
foreach($stap3[2] as开发者_如何转开发 $key => $value) {
$waardeSoortStage[$key] = $value;
}
Probably the variable $stap3[2]
is not an array.
I think you wanted to do so:
foreach($stap3 as $key => $value) {
$waardeSoortStage[$key] = $value;
}
because I think $stap3
is your array,$stab3[2]
might only be one member of it.
$stap3[2]
is not an array or an empty array.
You can check $stap3[2]
with is_array($stap3[2])
If is really array it returns true.
Also you can debug it with var_dump($stap3[2])
精彩评论