diff --git a/language/context/http.xml b/language/context/http.xml index 16fad3b3ad..89cf08d5b7 100644 --- a/language/context/http.xml +++ b/language/context/http.xml @@ -268,6 +268,36 @@ $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context); +?> +]]> + + + + + + Ignore redirects but fetch headers and content + + array('method' => 'GET', + 'max_redirects' => '0', + 'ignore_errors' => '1') + ); + +$context = stream_context_create($opts); +$stream = fopen($url, 'r', false, $context); + +// header information as well as meta data +// about the stream +var_dump(stream_get_meta_data($stream)); + +// actual data at $url +var_dump(stream_get_contents($stream)); +fclose($stream); ?> ]]>