note 111230 added to reserved.variables.httpresponseheader
| From: | miloshio at gmail dot com | Date: | Tue, 29 Jan 2013 11:17:23 +0000 |
| Subject: | note 111230 added to reserved.variables.httpresponseheader | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193421@lists.php.net to get a copy of this message | ||
This may be a slightly better way to catch all from http protocol:
<?php
function return_http($stringUrl, $header=true){
//brief check if it's right format
if(substr($stringUrl, 0, 7) !== 'http://' &&
substr($stringUrl, 0, 8) !== 'https://')
return die('Argument passed in function should be URL string starting with http:// or https://, other given');
//if $header is left to be true, we'll return array with headers and content
if($header){
return array('content'=>file_get_contents($stringUrl),
'header'=>$http_response_header);
} else return file_get_contents($stringUrl); // if not we'll get string with content
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 89.216.23.9
----
Manual Page -- http://php.net/manual/en/reserved.variables.httpresponseheader.php
Edit -- https://master.php.net/note/edit/111230
Del: integrated -- https://master.php.net/note/delete/111230/integrated
Del: useless -- https://master.php.net/note/delete/111230/useless
Del: bad code -- https://master.php.net/note/delete/111230/bad+code
Del: spam -- https://master.php.net/note/delete/111230/spam
Del: non-english -- https://master.php.net/note/delete/111230/non-english
Del: in docs -- https://master.php.net/note/delete/111230/in+docs
Del: other reasons-- https://master.php.net/note/delete/111230
Reject -- https://master.php.net/note/reject/111230
Search -- https://master.php.net/manage/user-notes.php