Fatal error: Cannot use string offset as an array 报错解决

$hte =1 ;
$sx['dx']['xiao']=explode(',','1,2,3,4,5,6,7,8,9,10,11,12');
if (in_array($hte,$sx['dx']['xiao'])){
   echo "hello";
}

上面代码在我的FUNCTION中报错Fatal error: Cannot use string offset as an array

查了一个晚上没查出原因

最后把$sx改名,解决问题,原来自定义function中有重名,我擦~~~

Leave a comment

You must be logged in to post a comment.