PHP triggered task execution is like this. how can I enable PHP to execute a specific code when the first person accessing the website on the first day of every month does not work until the first day of the next month, the first visitor executes the specific code again. as long as the visitor records on the first day of each month are written into the data table, the visitor records cannot be determined ., When fn { 'no_start.txt 'PHP triggered execution task
The problem is.
How can I enable PHP to execute a specific code when the first person accessing the website on the first day of every month fails to access the website,
Until No. 1 in next month, the first visitor will execute the specific code again.
------ Solution --------------------
If you write visitor records to the data table for users on the first day of each month, you can determine if the visitor records are correct.
------ Solution --------------------
$ Fn = 'no_start.txt ';
If (! File_exists ($ fn)
------ Solution --------------------
Date ('D', filemtime ($ fn ))! = 1 ){
Echo 'execute a specific code ';
File_put_contents ($ fn ,'');
}