[Online help] php timer problems

Source: Internet
Author: User
[Online help] Questions about php timers for beginners about php timers:
I want to write a timer in php, but php does not seem to support this function. I checked a lot of methods on the Internet, but none of them work,
I want to implement it through an endless loop, but it doesn't work either. ask for help...
 


Reply to discussion (solution)

What do you want?

What do you want? I want to get a session value on the page through php. if the page is closed or the session value becomes invalid, execute an SQL statement to modify the logon status of the current user.

Unfortunately, php does not have a timer.

Unfortunately, php does not have a timer. Yes, I know that php does not have a timer, so I want to implement it in other ways.

That is: knowing that it cannot be done for it ,?!?

There is no difficulty in the world, just afraid of people with heart

Php generally uses linux cron for timed batch.

Jquery latency, combined with ajax.

Crontab/scheduled task

Questions about the php timer:
I want to write a timer in php, but php does not seem to support this function. I checked a lot of methods on the Internet, but none of them work,
I want to implement it through an endless loop, but it doesn't work either. ask for help...
PHP code? 123456789101112 In fact, your method is feasible. The value should not be echo, because the echo information stored in the buffer during PHP running is not output before the program runs, so you cannot see the effect.
You can replace echo with a database operation statement, for example, adding 1 piece of data in less than 5 seconds.

In addition, it is recommended that you do not add ignore_user_abort during testing. this operation will run in the background, even if the browser is closed, the execution will continue unless it is stopped from the process.

Reference the landlord fff32165 reply: novice help questions about the php timer:
I want to write a timer in php, but php does not seem to support this function. I checked a lot of methods on the Internet, but none of them work,
I want to implement it through an endless loop, but it doesn't work either. ask for help...
PHP code? 123456789101112 I changed echo "test timer" to echo"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.