How to change file contents in PHP? -
I save a file in some information about users (such as bar user login page, last visit Time, and so on)
I want to read this information from the file, and update it (counting 1 on the counter, and change the previous visit time).
My question is: Do I do the file without opening twice?
I open the content for the first time, and then reopening it again and overwriting the content with the updated content.
Thank you!
Yes, you open it only once:
- Write data (eighlight)
- Read data (Fred)
- Close file (fclose)
Comments
Post a Comment