php file_get_contents返回T.

时间:2017-05-25 07:02:20

标签: php timeout file-get-contents

我对file_get_contents有一个奇怪的问题: 我从URL下载文本文件:

$opts = array('http'=>array('header' => 'Connection: close'));
$context = stream_context_create($opts);
$result = @file_get_contents($source, false, $context);
writeFile($target, $result);

这种方法在90%的情况下都能正常工作。但是,偶尔下载文件的内容只是一个单一的大写

  

Ť

它偶尔发生的事实让我相信它是某种与超时相关的问题。

  • 任何人都可以证实吗?
  • T来自哪里?
  • 什么是良好的超时值?

非常感谢任何见解。

干杯, 汤姆

0 个答案:

没有答案