fopen($handle, 'w+');
I’m looking to open a .CSV file, read each row and do something with a database, and then truncate the .CSV file and write something like
This file has been read.
w+ implies Read/write but the file is also truncated. So what’s the point of the read if fopen w+ will just erase what’s in it?
Use
a+From the documentation: