我对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%的情况下都能正常工作。但是,偶尔下载文件的内容只是一个单一的大写
Ť
它偶尔发生的事实让我相信它是某种与超时相关的问题。
非常感谢任何见解。
干杯, 汤姆