PHP 「Cannot use object of type stdClass as array」

原參考網址 https://blog.csdn.net/pengxuan/article/details/50520781 原因是使用 json_decode 後數組中的對象進行取值 解決方法(2種): 1、使用 json_decode($d, true)。就是使json_decode 的第二個變量設置爲 true。 2、json_decode($res) 返回的是一個對象, 不可以使用 $res
相關文章
相關標籤/搜索