ThinkPHP5 提示 variable type error:array 是因为在 ThinkPHP5 中不允许在直接访问控制器时通过 return 方法直接返回数组。
出现这个错误时,使用 json 函数处理以下返回的数据即可,如:
$data = [...];
return json($data);

(adsbygoogle = window.adsbygoogle || []).push({});
来源:https://www.02405.com/archives/1695