作者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/cn.aspx?n=bbs/PHP/M.1444135139.A.AA5.html