ID:              50347
 User updated by: php at hm2k dot org
 Reported By:     php at hm2k dot org
-Status:          Feedback
+Status:          Open
 Bug Type:        Streams related
 PHP Version:     5.3.1
 New Comment:

Your question is already answered by the sample code I provided.

For clarification: file_put_contents() is reading from a URL and
writing to a temp file.


Previous Comments:
------------------------------------------------------------------------

[2009-12-01 08:35:54] j...@php.net

What exactly are you trying to do? Write to HTTP? 

------------------------------------------------------------------------

[2009-12-01 00:56:24] php at hm2k dot org

Description:
------------
When using file_put_contents(), $http_response_header does not populate
as expected.

Reproduce code:
---------------
<?php
$file=tempnam('','');
$url='http://example.com/';
file_put_contents($file,$url);
var_dump($http_response_header);

Expected result:
----------------
array(9) {
  [0]=>
  string(15) "HTTP/1.1 200 OK"
  [1]=>
  string(35) "Date: Sat, 12 Apr 2008 17:30:38 GMT"
  [2]=>
  string(29) "Server: Apache/2.2.3 (CentOS)"
  [3]=>
  string(44) "Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT"
  [4]=>
  string(27) "ETag: "280100-1b6-80bfd280""
  [5]=>
  string(20) "Accept-Ranges: bytes"
  [6]=>
  string(19) "Content-Length: 438"
  [7]=>
  string(17) "Connection: close"
  [8]=>
  string(38) "Content-Type: text/html; charset=UTF-8"
}

Actual result:
--------------
false


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50347&edit=1

Reply via email to