note 34898 added to function.stream-set-timeout
| From: | php-general at lists dot php dot net | Date: | Mon, 11 Aug 2003 05:02:29 +0000 |
| Subject: | note 34898 added to function.stream-set-timeout | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53840@lists.php.net to get a copy of this message | ||
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?
----
Manual Page -- http://www.php.net/manual/en/function.stream-set-timeout.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34898
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34898&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34898&report=yes