目前对PHP流协议的定义是数据传输过程中,不同数据类型采用不同处理函数的技术规范(个人理解)这一规范比起传统文件处理函数来的更规范(诸如fget,fwrite,fopen,fclose等)
$opts =array(
‘http‘=>array(
‘method‘=>‘GET‘,
‘header‘=>‘Accept-language:zh\r\n‘,
),
);
$context = stream_context_create($opts);
$fp = file_get_contents(‘https://www.jianshu.com/p/04e5b9f1aecd‘,false,$context);
$fw = fopen(‘wuwa.html‘,‘w‘);
fwrite($fw,$fp);
fclose($fw);
原文:https://www.cnblogs.com/saintdingspage/p/11178718.html