Modrá je dobrázelená je lepšíLopuch.cz
$fp = fopen("/tmp/lock.txt", "r+"); if (flock($fp, LOCK_EX)) { // do an exclusive lock ftruncate($fp, 0); // truncate file fwrite($fp, "Write something here\n"); fclose($fp); /// tohel tu mema byt flock($fp, LOCK_UN); // release the lock } /// ma to by zde //fclose($fp);