更新时间:2023-12-04 12:52:46
移动括号:
if (($fd = fopen($file, "a")) !== false) {
fwrite($fd, 'message to be written' . "\n");
fclose($fd);
}
您的代码将(fopen($file, "a") !== false)
(即布尔值)的结果分配给$fd
.
Your code assigned the result of (fopen($file, "a") !== false)
(i.e. a boolean value) to $fd
.