Can you read a file concurrently with writing to a file using
file_put_contents?
When a user lands on the page, I want to write some information about
their browser/ip/location to a file.
At the top of the file I have some PHP code that checks my cookie and if I
am admin will echo the contents of the file to the page so I can see the
list of visitor data (using file_get_contents). I am going to make a
function that will display the data in a table at some point.
I am tempted to use file_put_contents with the FILE_APPEND flag is set
because it looks easy to use. Would there be any file permission conflicts
with reading and writing to the file, and if so, how does fopen/fwrite
avoid this conflict?
No comments:
Post a Comment