note 34898 deleted from function.stream-set-timeout by didou
| From: | didou@php.net | Date: | Mon, 11 Aug 2003 06:39:53 +0000 |
| Subject: | note 34898 deleted from function.stream-set-timeout by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53861@lists.php.net to get a copy of this message | ||
Note Submitter:
----
The example has confused me for a time since there is no explanation as to why the line "$start
= time();" is even in the example. I have decided that it is not needed and so I hope others
might not get confused here either.
It seems to me that this would be much less confusing.
<?php
$fp = fsockopen("www.example.com", 80);
if(!$fp) {
echo "Unable to open\n";
} else {
fputs($fp, "GET / HTTP/1.0\n\n");
stream_set_timeout($fp, 2);
$res = fread($fp, 2000);
var_dump(stream_get_meta_data($fp));
fclose($fp);
print $res;
}
?>
Am I wrong?