php文件读写锁 $file = fopen("test.txt", $fileOpenMode);flock($file, $lockMode) or die("Can't lock");//...flock($file, LOCK_UN);fclose($file);$fileOpenMode:"r"(读);"r+"(写)(不能用"w",否则由于先打开再加锁,打开后文件内容已经清空了... php 2023-10-07 49 点赞 0 评论 74 浏览