实际上,在进一步阅读该
file_get_contents()功能后:
// Create a stream$opts = [ "http" => [ "method" => "GET", "header" => "Accept-language: enrn" . "cookie: foo=barrn" ]];$context = stream_context_create($opts);// Open the file using the HTTP headers set above$file = file_get_contents('http://www.example.com/', false, $context);您也许可以遵循这种模式来实现您想要的目标,但是我还没有亲自测试过。(如果它不起作用,请随时查看我的其他答案)



