所以我正在使用足球联赛API,我让它返回我需要的数据.然而,它现在突然停止工作,我不知道为什么.
class leagueTable {
public $data;
public $baseUri;
public $config;
public $tr;
public function __construct($payload) {
$this->data = $payload;
$this->config = parse_ini_file('config.ini', true);
$this->baseUri = $this->config['baseUri'];
$this->writeTable();
}
public function writeTable() {
$resource = 'soccerseasons/' . $this->data . '/leagueTable';
$response = file_get_contents($this->baseUri . $resource, false, stream_context_create($this->reqPrefs));
if ($response == "") {
echo "Unable to retrieve data, please contact the administrator!
JSON";
}
$result = json_decode($response);
如果我回应$this-> baseUri. $resource我得到一个工作link所以为什么file_get_contents不能获取内容?