我有这个代码:
$file = fopen($_SERVER['DOCUMENT_ROOT'].'crawl.txt', 'w+');
$time1 = microtime(true);
......
$time2 = microtime(true);
$time = $time2-$time1;
$text = "Training id: ".$this->realIdTraining." Time: ".$time."\r\n";
fwrite($file, $text);
fclose($file);
sleep(5);
我发现了这个错误:Warning: fwrite(): 120 is not a valid stream resource
有什么想法我能做什么?
伙计们:必须添加正确书写的第一行。(!!!)