"解决Invalid argument supplied for foreach()"
Published on Aug. 22, 2023, 12:09 p.m.
只需要在前面判断下是不是数组就可以
if (is_array($variable)) {
foreach ($variable as $item) {
//do something
}
}
Published on Aug. 22, 2023, 12:09 p.m.
只需要在前面判断下是不是数组就可以
if (is_array($variable)) {
foreach ($variable as $item) {
//do something
}
}