$data = array(
);
$data_string = json_encode($data);
$ch = curl_init($api_signin);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$result = curl_exec($ch);
curl_close($ch);
$data = json_decode($result);
假設請求後他有多筆資料會用數組那我要怎麼寫while? or foreach?應該是說他有三層甚至四層array.....我要怎麼寫循環顯示?
添加回答
举报
0/150
提交
取消