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
Post a Comment