Can PHP fwrite be executed concurrently? PHPcode $ f2 = fopen ('File/index.txt ', 'w'); fwrite ($ f2, $ h. $ old); fclose ($ f2); E. g.: make a message board. I did not use the mysqlsoftware. directly write the message into a. txt file. what if the fwrite of PHP can be executed concurrently in the same second during peak hours?
PHP code
$ F2 = fopen ('File/index.txt ', 'w'); fwrite ($ f2, $ h. $ old); fclose ($ f2 );
For example, I made a message board. I didn't use MySQL or other software. I directly wrote the message into a. txt file.
If 50,000 people leave messages within the same second during peak hours.
Www.dbscripts.net/guestbook/demo/
Can PHP be executed concurrently without errors?
------ Solution --------------------
What's wrong?
You use the write method to open
File/index.txt is always the last written content
------ Solution --------------------
The write method will overwrite it.
------ Solution --------------------
I don't know. maybe the legendary file lock is the solution.