Answer the question
In order to leave comments, you need to log in
How to access a file without losing data?
How to access the file in order to read and rewrite data without loss.
Example: one script writes new values, the other reads and deletes, it is necessary that at the moment when they both process the file, the data is not lost. Since the second one can overwrite the data while the first one is adding them, something like this...
Answer the question
In order to leave comments, you need to log in
For this there is File locking
flock()
or
file_pit_contents('filename.txt', $my_data, LOCK_EX);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question