From 52846d4ff232f3aa4952be73e3a676c22055183d Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Wed, 17 Feb 2010 00:35:23 +0000 Subject: [PATCH] Apply user-patch from David Tajchreber, closes PHP Bug #38802 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@295190 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/context/http.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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); ?> ]]>