警告:in_array() 期望参数 2 为数组,第 229 行的FILE LOCATION HIDDEN FOR SAFETY 中给出了 null
第 223-235 行
223 if (count($dmos_forum_ids) > 0) {
225 // Loop through the new mgroups and make sure they are added to the existing
226 foreach ($dmos_forum_ids as $id) {
228 // If the current mgroups doesnt have the id...
229 if (in_array($id, $mgroup_others_array)) {
231 // Add it to the array
232 array_push($new_mgroup_others_array, $id);
233 }
234 }
235 }
我添加了横线数字以帮助了解线的位置。任何帮助将不胜感激
您需要确保您$mgroup_others_array
实际上是一个数组。
您可以将您的更改if
为:
if (is_array($mgroup_others_array) && in_array($id, $mgroup_others_array)) {
那将阻止您的warning
. 您不能对不是in_array()
一个的变量执行调用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句