0
晚上好,捲曲返回JSON結果
我使用捲曲發送GET請求,這是在迴歸提供一個JSON網址:
$material =
function sendRequest($item1, $item2){
$curl = curl_init('http://host.com/folder/?param1='.$item1.'¶m2='.$item2);
$resp = curl_exec($curl);
curl_close($curl); print_r($resp); //will return '1'
return $resp;
}
$JSONArray = json_decode($material,true);
在控制檯中,我可以看到什麼看起來是一個JSON響應,但是當我嘗試使用$ material或$ JSONArray時,我只能得到值'1'。
爲什麼JSONArray沒有收到完整的JSON文件?
謝謝!