How to decode a json response from API

后端 未结 3 468
一向
一向 2021-01-29 06:47

I am calling data from an API like this:

$curl = curl_init();
//adding fields to the curl object to enter the site
curl_setopt($curl, CURLOPT_URL, $my_url);
curl         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 07:03

    Not sure why is not working for you. When the json string is in the code it does work.

    Ouput:

    1 Books
    

    Btw my version

    PHP 5.6.30 (cli) (built: Aug  8 2017 12:20:45)
    

提交回复
热议问题