「php入門」 stream_context_create() を利用するサンプル

サンプルコード:
<?php
$qtm = array(
'http’=>array(
'method’=>"GET",
'header’=>"Accept-language: en\r\n" .
“Cookie: user=yama\r\n"
)
);

$context = stream_context_create($qtm);

$fp = fopen('http://www.sample.net’, 'r’, false, $context);
fpassthru($fp);
fclose($fp);
?>

PHP

Posted by arkgame