我有這樣的代碼:fwrite()錯誤:提供的參數不是有效的流資源。爲什麼?
$file = '/path/to/file.txt';
if (($fd = fopen($file, "a") !== false)) {
fwrite($fd, 'message to be written' . "\n");
fclose($fd);
}
爲什麼我得到下面的警告?
fwrite(): supplied argument is not a valid stream resource
fclose(): supplied argument is not a valid stream resource
Ups ...我錯過了。非常感謝! – Alex