php怎么实现定时提醒功能
phpcn_u699
phpcn_u699 2017-02-10 11:25:11
0
2
1661

比如想要实现这么一个功能:在用户生日当天或者提前几天就能自动给用户发送一条信息。

或者在会员到期日期的前两三天自动就能给用户发送信息,如何才能用PHP语言来自动化实现这么一个功能呢?


phpcn_u699
phpcn_u699

reply all(2)
数据分析师

How does php implement the scheduled reminder function - PHP Chinese website Q&A - How does php implement the scheduled reminder function - PHP Chinese website Q&A

Take a look around and learn.

巴扎黑

推荐使用workerman 或 swoole

//获取定时任务的配置
        $timing_task=api_base::load_config('zip_remove');        if($timing_task['is_remove']){
            
            \Man\Core\Lib\Task::add($timing_task['time_interval'], function(){                $zip_remove=api_base::load_sys_class('zpi_file');                
                $zip_xml_config=api_base::load_config('zip_xml');                $zip_path=$zip_xml_config['BCP_PATH'][0]['val'];                $timing_task=api_base::load_config('zip_remove');                if(!empty($timing_task['delete_zip_time'])){                    if(date('H:i',time())==$timing_task['delete_zip_time']){                        $zip_remove=new zpi_file();                        $zip_remove->remove_zip_file($zip_path);
                    }
                }else{                    $zip_remove=new zpi_file();                    $zip_remove->remove_zip_file($zip_path);
                }
                    
            });
        }

workerman 大概就是这种语法


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template