Intermediate Question: Multiple user write a single textfile

Hi all,

My php function is like this: [COLOR=red]A user able to add item by using fwrite to create a textfile, and then a code fread this textfile to list out all additional items and if the user confirm the listed items, no any further edit/delete, another set of code will generate the texfile into xml. All the process from create, add, list, edit, delete, sort to generate, i use fwrite, fread, w+ for create textfile and write xml, a+ for append new items to list. A simple flat text database system.[/COLOR]

The code works perfectly but now i want multiple users, instead of just one user, write the textfile at the same time and combine into one xml file. For example, user A and user B log in and create a new listing for different items at the same time in the same directory, thus, 2 .txt file created, but all i need is combine these two or more textfiles and output to one xml files that content different users data.

I hope someone here can help me out this. Many thanks. :slight_smile: