脚本宝典收集整理的这篇文章主要介绍了php – file_get_contents没有返回任何数据,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
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);
如果我回应$this-> baseUri. $resource我得到一个工作link所以为什么file_get_contents不能获取内容?
以上是脚本宝典为你收集整理的php – file_get_contents没有返回任何数据全部内容,希望文章能够帮你解决php – file_get_contents没有返回任何数据所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。