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

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

    here is the solution for similar problem which i was facing while extracting name from user profile facebook json object

    $uname=json_encode($userprof);
    $uname=json_decode($uname);
    echo "Welcome " . $uname -> name  ;
    

提交回复
热议问题