| // ポストするデータを連想配列で生成$data = http_build_query(
 array(
 'param1' => 'value1',
 'param2' => 'value2'
 )
 );
 
 // コンテキストのオプションを生成
 $option = array('http' =>
 array(
 'method'  => 'POST',
 'header'  => 'Content-type: application/x-www-form-urlencoded',
 'content' => $data
 )
 );
 
 $context  = stream_context_create( $option ); // コンテキストの生成
 
 // 生成したコンテキストを指定してファイルをオープン
 $handle = fopen("http://www.xxx.com/test.html",  "r", $context);
 
 
 
 |