0
我想從幾個交易所獲得交易量。當我加載這個東西時除了空白頁面之外什麼都不加載也許我錯過了一個小錯誤?比特幣交易量股票代碼API錯誤[PHP]
<?php
function getData($url) {
$decode = file_get_contents($url);
return json_decode($decode, true);
}
//BTC Volume on BTCE
$BTCVolumeBTCE = getData('https://btc-e.com/api/3/ticker/btc_usd');
$BTCEVolume = $BTCVolumeBTCE["btc_usd"]["vol_cur"];
//BTC Volume on Bitstamp
$BTCVolumeStamp = getData('https://www.bitstamp.net/api/ticker/');
$StampVolume = $BTCVolumeStamp["volume"];
//BTC Volume on OKCoin
$BTCVolumeOK = getData('https://www.okcoin.com/api/ticker.do?ok=1')
$OKCoinVolume = $BTCVolumeOK["vol"];
//BTC Volume Bitfinex
$BTCVolumeFinex = getData('https://api.bitfinex.com/v1/pubticker/btcusd');
$FinexVolume = $BTCVolumeFinex["volume"]
//BTC Volume LakeBTC
$BTCVolumeLake = getData('https://www.lakebtc.com/api_v1/ticker');
$LakeVolume = $BTCVolumeLake["USD"]["volume"]
?>
發生了什麼事?
好的,我會盡力找到它們。 – Darkstar
您正在使用哪種操作系統和服務器? – messy
14.04上的Ubuntu LAMP – Darkstar