Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 PHP 文件,它计算一个经常增加的值:
<?$totI=515905;?>
有时另一个文件会重置 $totI 变量(可能是因为它一起加载和写入两次)。
我怎样才能解决这个问题?
fopen($file,"a")我通过使用而不是在函数之后fopen($file,"w")添加来修复它ftruncateflock
fopen($file,"a")
fopen($file,"w")
ftruncate
flock