Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement schedule reminder in php

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how php to achieve schedule reminders, Xiaobian thinks it is quite practical, so share it for everyone to make a reference, I hope you can gain something after reading this article.

php How to implement schedule reminder: 1. Create a PHP sample file;2. Get the configuration of scheduled tasks, such as "$timing_task=api_base::load_config ('zip_remove');if($timing_task...) {...} "。

Operating environment: Windows 7 system, PHP 7.1 version, Dell G3 computer.

How does PHP implement calendar reminders? How does PHP implement timed reminders?

For example, if you want to implement such a function, you can automatically send a message to the user on the day of the user's birthday or a few days in advance. Or two or three days before the membership expiration date automatically send information to users, how can we use PHP language to automate such a feature?

Implementation method:

Workerman or swoole is recommended.

//Get configuration of timed task $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 is probably the syntax.

About "php how to achieve schedule reminder" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report