Contexts
最后更新于:2022-04-02 02:32:05
[TOC]
## 实例
### 模拟请求
```
$opts=[
'http'=>[
'method'=>'GEt',
'header'=>
"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
]
];
$context = stream_context_create($opts);
$fp = fopen('http://www.baidu.com', 'rb', false, $context);
fpassthru($fp); //全部輸出
fclose($fp);
```
';