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

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -