- file_get_contents: documentation ( source)
- stream_context_create: documentation ( source)
- implode: documentation ( source)
- http_build_query: documentation ( source)
<?php
$url = 'http://www.hackerschool.jp/hack/take22.php';
$data = array(
'pass' => 'take22password',
);
$headers = array(
'Cookie: PHPSESSID=hoge;',
);
$options = array('http' => array(
'method' => 'POST',
'content' => http_build_query($data),
'header' => implode("\r\n", $headers),
));
echo file_get_contents($url, false, stream_context_create($options));