json_decode() expects parameter 1 to be string, array given

后端 未结 6 690
清歌不尽
清歌不尽 2021-02-02 14:15

What causes this error in my code?

$query = $this->db->query(\"SELECT * FROM tour_foreign ORDER BY id desc\");
        $data = array();
        foreach ($q         


        
6条回答
  •  滥情空心
    2021-02-02 14:49

    Set decoding to true

    Your decoding is not set to true. If you don't have access to set the source to true. The code below will fix it for you.

    $WorkingArray = json_decode(json_encode($data),true);
    

提交回复
热议问题