标签:
<?php header("content-type:text/html;charset=utf-8"); $fp = fopen("lock.txt","w+"); if(flock($fp, LOCK_EX)){// 进行排它型锁定 fwrite($fp,"Write something here\n"); flock($fp, LOCK_UN);// 释放锁定 }else{ echo "Couldn‘t lock the file !"; } fclose($fp); ?>
source:http://www.bcty365.com/content-10-2954-1.html
标签:
原文地址:http://www.cnblogs.com/wuheng1991/p/5175409.html