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

后端 未结 6 680
清歌不尽
清歌不尽 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:35

    • Make an object

      $obj = json_decode(json_encode($need_to_json));

    • Show data from this $obj

      $obj->{'needed'};

    Reference

提交回复
热议问题