作者jami520 (我的生命因你而發光)
看板PHP
標題[請益] 如何curl這網站資訊呢?
時間Tue Oct 6 20:38:57 2015
單純點選網址可以正常看到資訊
http://goo.gl/v9Yr5r
但使用curl並沒有任何數據顯示,不曉得是哪邊的問題呢? 謝謝
$c = curl_init();
curl_setopt($c, CURLOPT_URL,
"
http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_3008.tw|tse_2330.
tw&json=1&delay=0&d=20151006");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$timeout = 15;
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($c);
curl_close($c)
echo $data;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 182.235.190.240
※ 文章網址: https://webptt.com/m.aspx?n=bbs/PHP/M.1444135139.A.AA5.html