I have a variable $Date that is automatically updated each day. I would like to create a new text file each time that there is a new entry. So basically every day.
I would like to use fopen to create a new text file every time a user submits a value, but only for that day. If a user creates another account the next day, it will be a new text file with that date for a name…
I only have three variables, $date, $Name, and $number
Is it possible to create this as follows?
$textmember = "$date.txt"
Yes, you could easily create a new text file each day.
If you’re appending data to the file, you don’t even need to do the
file_exists()check, you can just use the ‘a’ option offopen():In this case, the file will be created if it doesn’t exist, and if it does, the data you write will just be appended on the end.