function is the title, I really can not think of what way and ideas to solve, what is the best way for everyone?
Or paste the code, provide the next idea!
Reply content:
function is the title, I really can not think of what way and ideas to solve, what is the best way for everyone?
Or paste the code, provide the next idea!
The PHP script is as follows:
if (date("Y-m-t") == date('Y-m-d')) { //Do Something;}
Configure Crontab to run the PHP script once a day.
Actually very simple, really ...
$date = new DateTime("now", new DateTimeZone('Asia/Shanghai'));echo $date->modify('last day of this month')->format('Y-m-d');
Just a little bit more about automatic triggering, automatic triggering if cron
you set the script to execute once a day.
Php
set_time_limit(0);// 不是一个月最后一天, 略过if (date('d') != date('t')) { exit(0);}// 业务逻辑 something to do
Crond
0 6 * * * * php /xxx/xxx/xxx.php
Many domestic program simulation corn, is to use JavaScript to call PHP files, in the file to determine whether to meet the implementation standards.
In other words, you must have a steady flow of requests. Others want to, ask this question probably you also can not use cron.