AlbertAguirre
Programmer
I am using the file_put_contents with the append option.
Code:
file_put_contents("filename", "text to write", FILE_APPEND);
Problem is that I want to lock the file as well as append.
Php documentation says to use the "LOCK_EX" flag, however, it does not have examples. How do I pass BOTH the FILE_APPEND and LOCK_EX flags?
Like this?
file_put_contents("filename", "text to write", FILE_APPEND, LOCK_EX);
I dont think the above will work because there is a fourth parameter that can be passed to this function.
Thoughts?
Code:
file_put_contents("filename", "text to write", FILE_APPEND);
Problem is that I want to lock the file as well as append.
Php documentation says to use the "LOCK_EX" flag, however, it does not have examples. How do I pass BOTH the FILE_APPEND and LOCK_EX flags?
Like this?
file_put_contents("filename", "text to write", FILE_APPEND, LOCK_EX);
I dont think the above will work because there is a fourth parameter that can be passed to this function.
Thoughts?