php - Write to file but not erase -


is a function of writing I have .txt file I my problem is that it writes only on the first line, So, eliminating the old line for the new line. I want to add new lines to the file.

  function log ($ log, $ filename = '') {$ logfile = "log /" date ('YMD') $ Filename. "txt."; If ($ FH = FOPAN ($ logfile, 'W')) {Fraite ($ FH, date ('H: I: s'). "|". $ Log. "\ N"); fclose ($ FH); Return 1; } And false return; }    

You have to search before posting your question. north anyway, it fopen ($ logfile, 'w') with fopen ($ logfile, 'a') Change

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -