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 person to visit will execute a specific code and share it to: more PHP triggered tasks.
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.
Share: More
------ 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 ,'');
}