So i'm using a football league API, I had it returning the data I needed. However it has now stopped working all of a sudden and im not sure why.
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!<br />
<a target='_blank' href='".$this->baseUri.$resource."'>JSON</a>";
}
$result = json_decode($response);
If I echo out $this->baseUri . $resource
I get a working link so why can't file_get_contents get the contents?