PHP- php爬台股即時股價問題

匿 匿名 829 次瀏覽 0 個回答

乳提 小弟想要抓取
https://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_2330.tw&
收盤價

function get_Stock_price(){

$url =
"https://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_2330.tw";

$data = file_get_contents($url);

$data = json_decode($data,true);

echo $data['msgArray']['c'];
}

卻怎麼試都抓不到資料,會是在get資料這一端就出現問題
還是語法有誤嗎?

第一次發文 如果有不妥或排版不佳請見諒

--

我要回答

0 個回答

還沒有人回答,你知道答案嗎?

我要回答

登入會員後即可回答問題。

免費註冊