PHP文件计数器遇到的问题-并发写文件
function pageVisitCount() {
$file = 'count.txt'
$count = file_get_contents($file);
if($fp = fopen($file, 'r+')) {
if (flock($file,LOCK_EX))
$count = $count + 1;
$count = fwrite($fp, $count);
floc
原创
2011-04-27 23:14:00 ·
953 阅读 ·
2 评论