Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $file = fopen("test.txt","w+");
- if (flock($file,LOCK_EX))
- {
- fwrite($file,"Write something");
- sleep(10);
- flock($file,LOCK_UN);
- }
- else
- {
- echo "Error locking file!";
- }
- fclose($file);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement