flock

PHP 4, PHP 5, PHP 7, PHP 8
flock - Portable advisory file locking
Manual
Code Examples

Example #1 flock example

PHP Version:

Example #2 flock using the <span class='function-constant'>LOCK_NB</span> option

PHP Version: