<?php $html = file_get_contents('http://www.example.com'); print_r($http_response_header); // or $fp = fopen('http://www.example.com', 'r'); print_r(stream_get_meta_data($fp)); fclose($fp); ?> |
<?php $data = array ('foo' => 'bar'); $data = http_build_query($data); $opts = array ( 'http' => array ( 'method' => 'POST', 'header'=> "Content-type: application/x-www-form-urlencoded\\r\\n" . "Content-Length: " . strlen($data) . "\\r\\n", 'content' => $data ), ); $context = stream_context_create($opts); $html = file_get_contents('http://www.example.com', false, $context); echo $html; ?> |