How to create a new text file in php once a new day starts for a continuous running process
<p>I am running a spider (continuous processes) where I am creating a error log file (errorlog.txt) when a error occurs.However once the new day starts ie after 12 am the errors are still written in the previous day file.</p>

<p>Eg: If i run the spider on 30 May,once the time is 12 am and any error occurs in the spider the errors are still written in the text file for 30 May.How can a new file be created once an error occurs and the next day has started ? Please help</p>
